Tensorflow:ImportError:DLL加载失败:找不到模块



使用tensorflow时,我收到以下错误消息:

C:UsersMarieAppDataLocalProgramsPythonPython37python.exe C:/Users/Marie/Documents/emma&marie/mic/deepvoxnet/demo/demo_rthn.py
Traceback (most recent call last):
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflowpythonpywrap_tensorflow.py", line 64, in
<module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: Kan opgegeven module niet vinden.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packageskeras__init__.py", line 3, in <module>
from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflow__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflowpython__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflowpythoneagercontext.py", line 35, in <mo
dule>
from tensorflow.python import pywrap_tfe
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflowpythonpywrap_tfe.py", line 28, in <modul
e>
from tensorflow.python import pywrap_tensorflow
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflowpythonpywrap_tensorflow.py", line 83, in
<module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packagestensorflowpythonpywrap_tensorflow.py", line 64, in
<module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: Kan opgegeven module niet vinden.

Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Marie/Documents/emma&marie/mic/deepvoxnet/demo/demo_rthn.py", line 9, in <module>
import keras
File "C:UsersMarieAppDataLocalProgramsPythonPython37libsite-packageskeras__init__.py", line 6, in <module>
'Keras requires TensorFlow 2.2 or higher. '
ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`
Process finished with exit code 1

似乎找不到模块py_wrap。这是一个相对常见的问题,我在网上找到了很多解决方案,但似乎没有一个有效。。。我使用的是64位版本的python,并尝试了很多方法来解决这个问题;降级tensorflow(这不是一个选项,因为另一个软件包keras需要tensorflow 2.2(,重新安装seaborn和tensorflow,以及这里提供的几乎所有其他解决方案。怎么了?

您使用的Tensorflow 1似乎具有最高的Keras版本。

在他们的GitHub上关注Keras的公告。对于Tensorflow 1,尝试将Keras的版本降级为2.2.5或更低,对于Tensorflow 2,尝试将其降级为2.4.0。

然而,如果你想使用Tensorflow 2,他们建议在经常更新的Tensorflow中使用Keras(查看Github:https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/keras)

最新更新