重点看你安装的哦版本。不同版本会有不同,错误一样,版本不一样解决方案会有差别 真的是困难重重
C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\Scripts\python.exe E:/work/facode/renlian-master/face_train.py
Traceback (most recent call last):
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。
有的博客说
python
import keras
出现 ImportError: No module named 'tensorflow.core'
输入
>>> pip install --upgrade tensorflow-gpu
>>> pip install --upgrade tensorflow
>>> pip install keras -U --pre
解决 ImportError: No module named 'tensorflow.core'
错误并没有解决
卸载重新安装
Traceback (most recent call last):
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。
导入但还是失败
解决方案:
进入https://www.tensorflow.org/install/errors
安装2.1.0版本程序包需要msvcp140_1.dll文件,点击上图中的Microsoft VC++ downloads下载安装包并下载,即可成功导入Tensorflow。
下载地址:https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads