看板 Python 關於我們 聯絡資訊
想請教版上大大 小弟在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 ---> 12 with tf.Session() as sess: 13 14 print("y: {}\n".format(sess.run(y))) ~\anaconda3\envs\DL\lib\site-packages\tensorflow_core\python\client\session.py in __init__(self, target, graph, config) 1583 protocol buffer with configuration options for the session. 1584 """ -> 1585 super(Session, self).__init__(target, graph, config=config) 1586 # NOTE(mrry): Create these on first `__enter__` to avoid a reference cycle. 1587 self._default_graph_context_manager = None ~\anaconda3\envs\DL\lib\site-packages\tensorflow_core\python\client\session.py in __init__(self, target, graph, config) 672 673 if config is None: --> 674 config = context.context().config 675 676 if not isinstance(config, config_pb2.ConfigProto): ~\anaconda3\envs\DL\lib\site-packages\tensorflow_core\python\eager\context.py in config(self) 799 """Return the ConfigProto with all runtime deltas applied.""" 800 # Ensure physical devices have been discovered and config has been imported --> 801 self._initialize_physical_devices() 802 803 config = config_pb2.ConfigProto() ~\anaconda3\envs\DL\lib\site-packages\tensorflow_core\python\eager\context.py in _initialize_physical_devices(self) 1052 return 1053 -> 1054 devs = pywrap_tensorflow.TF_ListPhysicalDevices() 1055 self._physical_devices = [ 1056 PhysicalDevice(name=d.decode(), InternalError: failed to get compute capability major for device: UNKNOWN ERROR (1); 0 我自己找了好久都找不到答案,想請問這大概是發生什麼樣的錯誤? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.168.35.78 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1601902498.A.2F3.html
yiche: 你裝的是gpu版本的TensorFlow嗎? 10/05 23:49
s59654655: 仔細看錯誤提示!找不到gpu,安裝cpu版本吧 10/06 00:00
pmove: 想辦法建個GPU環境再跑吧? 10/06 17:17
sheman: 感謝大大建議,問題解決了!! 10/06 21:52