tensorflow的session問題已刪文
想請教版上大大
小弟在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.1601902339.A.B4D.html
Python 近期熱門文章
PTT數位生活區 即時熱門文章