简体   繁体   English

Tensorflow-GPU错误-Pycharm

[英]Tensorflow-GPU Error - Pycharm

I am installing Tensor flow. 我正在安装Tensor Flow。

I was having trouble installing through Anaconda, so I uninstalled everything including Python, and downloaded Python 3.5 from here: 我在通过Anaconda进行安装时遇到了麻烦,因此我卸载了包括Python在内的所有内容,并从此处下载了Python 3.5:

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

After installing Python 3.5 I installed PyCharm, and set my path variables so that it could find the Python folder. 安装Python 3.5之后,我安装了PyCharm,并设置了路径变量,以便它可以找到Python文件夹。

Then I used command prompt to install tensorflow using: 然后我使用命令提示符使用以下命令安装tensorflow:

pip3 install --upgrade tensorflow-gpu

Anyway, it installed tensorflow and the other stuff like numpy, protobuf, etc I set up a project in PyCharm and set the interpreter to the default one located in the Python35 folder. 无论如何,它安装了tensorflow以及其他东西,例如numpy,protobuf等,我在PyCharm中设置了一个项目,并将解释器设置为位于Python35文件夹中的默认程序。

I opened up the Python console within Pycharm and typed: 我在Pycharm中打开了Python控制台并输入:

import tensorflow

to get this error: 得到这个错误:

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.

I hope that is enough detail for someone to help me. 我希望有人提供足够的细节来帮助我。

You are missing some dependencies. 您缺少一些依赖项。 I would recommend to rebuild it from scratch. 我建议从头开始重建它。 Use this guide for Windows. 对于Windows使用此指南

You need to fulfill the requirements for running TF GPU. 您需要满足运行TF GPU的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM