这是我第二次经历张量流(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