Tensorflow-GPU错误 - Pycharm

问题描述:

我正在安装张量流。Tensorflow-GPU错误 - Pycharm

我遇到了麻烦,通过蟒蛇安装,所以我卸载了一切,包括Python和从这里下载的Python 3.5:

https://www.python.org/downloads/release/python-352/

安装Python 3.5我安装PyCharm后,并设置我的路径变量,这样它可以找到Python文件夹。

然后我用命令提示符来安装tensorflow使用:

pip3 install --upgrade tensorflow-gpu 

无论如何,它安装tensorflow和其他东西一样numpy的,protobuf的,等 我成立了PyCharm项目,并设置解释为默认的一个位于Python35文件夹中。

我内Pycharm打开了Python的控制台和类型:

import tensorflow 

得到这个错误:

import tensorflow 
    Traceback (most recent call last): 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper 
     return importlib.import_module(mname) 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py", line 126, in import_module 
     return _bootstrap._gcd_import(name[level:], package, level) 
     File "<frozen importlib._bootstrap>", line 986, in _gcd_import 
     File "<frozen importlib._bootstrap>", line 969, in _find_and_load 
     File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked 
     File "<frozen importlib._bootstrap>", line 666, in _load_unlocked 
     File "<frozen importlib._bootstrap>", line 577, in module_from_spec 
     File "<frozen importlib._bootstrap_external>", line 906, in create_module 
     File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed 
    ImportError: DLL load failed: The specified module could not be found. 
    During handling of the above exception, another exception occurred: 
    Traceback (most recent call last): 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module> 
     from tensorflow.python.pywrap_tensorflow_internal import * 
     File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import 
     module = self._system_import(name, *args, **kwargs) 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module> 
     _pywrap_tensorflow_internal = swig_import_helper() 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper 
     return importlib.import_module('_pywrap_tensorflow_internal') 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\importlib\__init__.py", line 126, in import_module 
     return _bootstrap._gcd_import(name[level:], package, level) 
    ImportError: No module named '_pywrap_tensorflow_internal' 
    During handling of the above exception, another exception occurred: 
    Traceback (most recent call last): 
     File "<input>", line 1, in <module> 
     File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import 
     module = self._system_import(name, *args, **kwargs) 
     File "C:\Users\Justin\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\__init__.py", line 24, in <module> 
Failed to load the native TensorFlow runtime. 

我希望这是足够的细节有人来帮助我。

您缺少一些依赖关系。我会建议从头开始重建它。 Windows使用this guide

您需要满足运行TF GPU的要求。