Python Can';t从CMD启动张力板
我已经设法让TensorFlow(GPU)在Python 3.5.2中工作,但是当我尝试从命令提示符启动Python Can';t从CMD启动张力板,python,tensorflow,cmd,tensorboard,Python,Tensorflow,Cmd,Tensorboard,我已经设法让TensorFlow(GPU)在Python 3.5.2中工作,但是当我尝试从命令提示符启动tensorboard时,我遇到以下错误: C:\Users\Alex>tensorboard --logdir /tmp/data Traceback (most recent call last): File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in sw
tensorboard
时,我遇到以下错误:
C:\Users\Alex>tensorboard --logdir /tmp/data
Traceback (most recent call last):
File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(__file__)])
File "c:\python35\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python35\lib\site-packages\tensorflow\python\__init__.py", line 54, in <module>
from tensorflow.python import pywrap_tensorflow
File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python35\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "c:\python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python35\Scripts\tensorboard.exe\__main__.py", line 5, in <module>
File "c:\python35\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "c:\python35\lib\site-packages\tensorflow\python\__init__.py", line 60, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(__file__)])
File "c:\python35\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python35\lib\site-packages\tensorflow\python\__init__.py", line 54, in <module>
from tensorflow.python import pywrap_tensorflow
File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "c:\python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ImportError: No module named '_pywrap_tensorflow'
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
当我运行它时,它会输出以下内容:
TensorFlow successfully installed.The installed version of TensorFlow includes GPU support.
如果您使用的是TensorFlow GPU v1.3,请确保您使用的是cuDNN v5.1,而不是6.0 如合同所述: cudnnv5.1。有关详细信息,请参阅NVIDIA的文档。请注意,cuDNN通常安装在与其他CUDA DLL不同的位置。确保将安装cuDNN DLL的目录添加到%PATH%环境变量中 如果您有上述软件包之一的不同版本,请更改为指定的版本。特别是,cuDNN版本必须完全匹配:如果找不到cuDNN64_5.dll,TensorFlow将不会加载。要使用不同版本的cuDNN,必须从源代码生成
从命令窗口运行Tensorboard(不是python,而是python 3.5.2的命令窗口)
您可以创建新的环境变量名“tensrobaord” 和vlaue“python C:\Anaconda\Lib\site packages\tensorboard\main.py” 然后运行命令tensorboard--logdir=your_log_dir对于tensorflow 2.0.0b1(使用PyCharm时),在
PyCharmProjectFolder\venv\Scripts
中有一个名为tensorboard.exe的可执行文件,因此您可以直接从命令提示符运行它:
C:\Users\Alex>PyCharmProjectFolder\venv\Scripts\tensorboard.exe--logdir/tmp/data
谢谢您的建议。我已经安装了cuDNNv5.1,并在上面的编辑中用脚本检查它是否正确安装。我还检查了C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.01
是否在系统环境变量列表中,但它仍然不起作用。您能看到pip3列表中的张力板吗?Mine显示了以下两个:tensorflow gpu(1.3.0)tensorflow tensorboard(0.1.5)@MaosiChen pip3列表显示:tensorflow(0.12.0)、tensorflow gpu(1.3.0)和tensorflow tensorboard(0.1.6)我不确定,但旧的CPU版本(0.12.0)是否可能导致一些冲突?你能试着卸载所有的gpu并重新安装最新的gpu版本吗?pip3安装--升级tensorflow GPU在运行pip3安装--升级tensorflow
后,它现在可以工作了。您是对的,问题是由tensorflow(0.12.0)
引起的。谢谢你的建议!
TensorFlow successfully installed.The installed version of TensorFlow includes GPU support.