[问题] tensorflow的session问题

楼主: sheman (夜露死苦)   2020-10-05 20:54:56
想请教版上大大
小弟在Anaconda的环境下使用tensorflow 1.15版
只是简单先跑个程式,程式码如下:
import tensorflow as tf
x = tf.constant([[1, 2],[3, 4]], name='x')
y = tf.constant([[5, 6],[7, 8]], name='y')
with tf.Session() as sess:
print("y: {}\n".format(sess.run(y)))
没想到出现以下的错误讯息:
InternalError Traceback (most recent call last)
<ipython-input-5-abbc1cf59ac4> in <module>
10 # tf_neg = -x
11
作者: yiche (你若安好,便是晴天)   2020-10-05 23:49:00
你装的是gpu版本的TensorFlow吗?
作者: s59654655 (s596546ff)   2020-10-06 00:00:00
仔细看错误提示!找不到gpu,安装cpu版本吧
作者: pmove (金疾柠檬)   2020-10-06 17:17:00
想办法建个GPU环境再跑吧?
楼主: sheman (夜露死苦)   2020-10-06 21:52:00
感谢大大建议,问题解决了!!

Links booklink

Contact Us: admin [ a t ] ucptt.com