【问题标题】:Tensorflow No module named _pywrapTensorflow 没有名为 _pywrap 的模块
【发布时间】:2017-04-28 13:55:29
【问题描述】:

我对 tensorflow 有点陌生,只有一些时间在我们安装了它的大学计算机上玩过它。今天是我终于有时间在家尝试的重要日子,但后来我遇到了一些错误,我找不到任何解决方案

   Traceback (most recent call last):
  File "C:\Users\gustav\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\gustav\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 914, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: Det går inte att hitta den angivna modulen.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\gustav\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:\Users\gustav\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\gustav\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\gustav\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 "<pyshell#0>", line 1, in <module>
    import tensorflow as tf
  File "C:\Users\gustav\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\gustav\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\gustav\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\gustav\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\gustav\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 914, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: Det går inte att hitta den angivna modulen.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\gustav\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:\Users\gustav\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\gustav\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\gustav\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'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

这里可能有点瑞典语,但问一下,我会翻译

电脑:i7 4770k 2xgtx 980 windows 10 python 3.5.3 tensorflow-gpu

【问题讨论】:

  • 你是如何安装 tensorflow 的?看起来可能存在路径错误或其他问题。请参阅问题stackoverflow.com/questions/35953210/… 有类似的错误
  • @AlexandrePassos 我使用 pip3 install --upgrade tensorflow-gpu 安装了它
  • 确实尝试了链接上的内容,但似乎没有用
  • 你看这里的常见安装问题列表了吗? tensorflow.org/install/…
  • 是的,我做到了,我什至尝试重新安装 visualc++ 仍然是同样的问题。查找了一些人在遇到此错误时丢失的dll文件并将其链接到路径中但仍然存在同样的问题

标签: python windows python-3.x tensorflow


【解决方案1】:

几天来我一直处于同样的情况,并尝试了以上所有方法。最终解决的是手动更新我的 gpu 卡控制器。

http://www.nvidia.es/Download/index.aspx?lang=es 确保选择正确的型号并下载驱动程序。安装,重启,你就可以开始了。

【讨论】:

  • 谢谢。终于没有绑定到慢速cpu版本
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-02-23
  • 2017-07-03
  • 2021-11-23
  • 1970-01-01
相关资源
最近更新 更多