Tensorflow - 没有名为“_pywrap_tensorflow_internal”的模块

本10

目前我正在尝试在我的电脑上运行 tensorflow - Windows 64bit(只是 cpu 版本)。运行命令时,python object_detection/builders/model_builder_test.py我收到以下错误。我在网上搜索,99%的答案是使用cd,我想我已经尝试过但没有奏效。我说“我认为”是因为我不知道我是否真的正确地尝试使用 cd - 因为我不是 100% 在我的场景中如何使用 cd。

C:\Users\Benan\Documents\BaseballProject>python tensorflow/models/research/object_detection/builders/model_builder_test.py
    Traceback (most recent call last):
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
        return importlib.import_module(mname)
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 571, in module_from_spec
      File "<frozen importlib._bootstrap_external>", line 922, in create_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
        return importlib.import_module('_pywrap_tensorflow_internal')
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "tensorflow/models/research/object_detection/builders/model_builder_test.py", line 18, in <module>
        import tensorflow as tf
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
        from tensorflow.python import *  # pylint: disable=redefined-builtin
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
        from tensorflow.python import pywrap_tensorflow
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
        raise ImportError(msg)
    ImportError: Traceback (most recent call last):
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
        return importlib.import_module(mname)
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 571, in module_from_spec
      File "<frozen importlib._bootstrap_external>", line 922, in create_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
        return importlib.import_module('_pywrap_tensorflow_internal')
      File "C:\Users\Benan\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'


    Failed to load the native TensorFlow runtime.

提前致谢!!

本10

我能够自己修复它,方法如下:

在 github 页面https://github.com/tensorflow/tensorflow/issues/17386 上,我发现这个问题的原因可能是由于 CPU 缺少 AVX 指令。高级向量扩展 (AVX) 是一组用于执行单指令多数据 (SIMD) 操作的指令。

我运行的是 Intel Core Duo,它没有出现在所有 AVX 兼容的 AMD 和 Intel CPU 的列表中,可以在这里找到:https : //en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX

在那个 github 页面上,一个名为 fo40225 的用户为 tensorflow 编译了一个 .whl,它是在没有 AVX 的情况下构建的。可以在这里找到:https : //github.com/fo40225/tensorflow-windows-wheel/tree/master/1.9.0/py36/CPU/sse2

首先,我必须使用 卸载 tensorflow pip uninstall tensorflow,然后使用 .whl 重新安装它,该 .whl 已在没有 AVX 的情况下使用pip install /example/path/to/.whl

安装后问题解决!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

没有名为'_pywrap_tensorflow_internal'的模块

Tensorflow ImportError:Windows 10上没有名为'_pywrap_tensorflow_internal'的模块

如何修复“导入错误:没有名为'_pywrap_tensorflow_internal'的模块”

ModuleNotFoundError: 没有名为“_pywrap_tensorflow_internal”的模块。无法加载本机 TensorFlow 运行时

Tensorflow 没有名为 _pywrap 的模块

没有名为“ _pywrap_tensorflow”的模块

错误-没有名为'_pywrap_tensorflow'的模块

TensorFlow导入错误:没有名为_pywrap_tensorflow的模块

Windows 上的 Tensorflow-gpu:ImportError:没有名为 _pywrap_tensorflow 的模块

Tensorflow 1.7- Windows-没有名为pywrap的模块

ModuleNotFoundError:没有名为“ tensorflow”的模块

Tensorflow导入错误:没有名为'tensorflow'的模块

(Tensorflow流设置)ImportError:没有名为tensorflow的模块

tensorflow.python.pywrap_tensorflow_internal没有模块Windows 10 tensorflow gpu

ModuleNotFoundError:Jupyter Notebook中没有名为“ tensorflow”的模块

ModuleNotFoundError:没有名为“ tensorflow.contrib.framework”的模块

安装后没有名为“ tensorflow_examples”的模块

ModuleNotFoundError:没有名为“ tensorflow.examples”的模块

ImportError:没有名为“ tensorflow.core”的模块

无法导入Tensorflow“没有名为copyreg的模块”

ModuleNotFoundError:anaconda中没有名为“ tensorflow”的模块

没有名为'tensorflow_probability'的模块

导入错误:没有名为“tensorflow”的模块

ModuleNotFoundError:没有名为“ tensorflow.tensorboard.tensorboard”的模块

Tensorflow对象检测:ImportError:没有名为nets的模块

ImportError:没有名为“ tensorflow.contrib.data”的模块

ModuleNotFoundError:没有名为“tensorflow.python”的模块Anaconda

ModuleNotFoundError:没有名为“ tensorflow.examples.tutorials”的模块

ModuleNotFoundError:没有名为“ tensorflow”的模块与代码