我已经阅读了多篇有关此问题的文章,但是运气不好解决。
我正在使用tensorflow-cpu版本2.3.1,Python 3.7.3。我已经使用pip下载了。我不断得到ImportError
,但不确定从这里开始做什么,大多数帖子都在谈论tensorflow-gpu版本。
这是我的完整追溯:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe
File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
答案 0 :(得分:0)
卸载所有Visual Studio先前版本并重新安装新版本后,由于Tensorflow Error: ImportError: DLL load failed: The specified module could not be found
,它摆脱了ImportError
。
但是在那之后,每次获取ModuleNotFoundError
时,我都会继续获取,卸载该模块并重新安装它。我的猜测是,存在彼此不兼容的版本。但是无论如何,它解决了我的问题。