這是我第二次經歷張量流(gpu)的整個安裝過程。Tensorflow GPU正確安裝,但Anaconda在CPU上運行它
# Creates a graph.
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print(sess.run(c))
它成功地認識到GPU和運行在其上的基質的功能:當我在CMD activate tensorflow
運行,然後,如果我在Python解釋裝入以下測試代碼這個時候。當我打開Anaconda Spyder IDE時,並以相同的方式運行相同的測試,解釋器說代碼正在CPU上運行。我該如何解決這個問題?什麼可能導致它? 我在Win 10上運行。
任何幫助都會很有用,謝謝您提前。
親切的問候, Konny
當你打開spyder env時,你是什麼意思?這是一個不同的環境? – JCooke
我的意思是Spyder IDE,會編輯它。 – KDX2
沒有使用它,但你確定它使用正確的解釋器嗎? – JCooke