简体   繁体   English

Keras 需要 TensorFlow 2.2 或更高版本,我有 tensorflow 2.4

[英]Keras requires TensorFlow 2.2 or higher,I have tensorflow 2.4

Here is my system info:这是我的系统信息:

  • python == 3.7.9 python == 3.7.9
  • keras == 2.2.0 keras == 2.2.0
  • Tensorflow 2.2.0 Tensorflow 2.2.0

I also tried with我也试过

  • keras == 2.4.0 keras == 2.4.0
  • Tensorflow 2.4.0 Tensorflow 2.4.0

and I also tried to install VC_redist.x64 But it doesn't always work我也尝试安装 VC_redist.x64 但它并不总是有效

Any solutions?有什么解决办法吗?

Traceback (most recent call last):
  File "C: \ Users \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ tensorflow \ python \ pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
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 \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ keras \ __ init__.py", line 3, in <module>
    from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
  File "C: \ Users \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ tensorflow \ __ init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C: \ Users \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ tensorflow \ python \ __ init__.py", line 39, in <module>
    from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
  File "C: \ Users \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ tensorflow \ python \ pywrap_tensorflow.py", line 83, in <module>
    raise ImportError (msg)
ImportError: Traceback (most recent call last):
  File "C: \ Users \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ tensorflow \ python \ pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.


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/Mahdia/PycharmProjects/projet1/LP_Video8Dataframe.py", line 9, in <module>
    from keras.models import model_from_json
  File "C: \ Users \ Mahdia \ PycharmProjects \ project1 \ venv \ lib \ site-packages \ keras \ __ 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`

I think the problem is in your PATH environment variable.我认为问题出在您的 PATH 环境变量中。 The packages used in the IDE terminal are different from those used by your chosen IDE environment (and interpreter). IDE 终端使用的包与您选择的 IDE 环境(和解释器)使用的包不同。 Try to change the path in the PATH variable (don't forget the PATH system) to the same path used by your IDE environment.尝试将 PATH 变量中的路径(不要忘记 PATH 系统)更改为 IDE 环境使用的相同路径。 So you will use the same versions and same packages of the IDE environment (and therefore TensorFlow 2.4 instead of 2.2)因此,您将使用 IDE 环境的相同版本和相同包(因此 TensorFlow 2.4 而不是 2.2)

If you run from the IDE terminal don't forget to restart the IDE (or create a new session terminal) so that it loads the new paths of your environment variables.如果您从 IDE 终端运行,请不要忘记重新启动 IDE(或创建一个新的 session 终端),以便它加载您的环境变量的新路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入错误:Keras 需要 TensorFlow 2.2 或更高版本。 在 Windows 上通过 `pip install tensorflow` 安装 TensorFlow - ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow` on Windows ImportError:Keras 需要 TensorFlow 2.2 或更高版本。 通过 `pip install tensorflow` 安装 TensorFlow - ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow` 如何解决 ImportError:Keras 需要 TensorFlow 2.2 或更高版本。 通过“pip install tensorflow”安装 TensorFlow? - How to solve ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install tensorflow`? 我是否成功安装了 TensorFlow 和 Keras? - Have I successfully installed TensorFlow and Keras? 如何在 anaconda 上安装 tensorflow 2.4&gt;? - How do I install tensorflow 2.4> on anaconda? tensorflow-gpu 2.2 适用于 CUDA 10.2 但需要 cuDNN 7.6.4,它在 NVIDIA 存档中没有 CUDA 10.2 的下载文件 - tensorflow-gpu 2.2 works with CUDA 10.2 but requires cuDNN 7.6.4 which doesn't have a download file in NVIDIA archive for CUDA 10.2 如何在 Tensorflow 2.2 中使用多个输入训练 Keras model? - How to train Keras model with multiple inputs in Tensorflow 2.2? 通过 Keras 2.4.3 和 Tensorflow 2.2 从 SavedModel 中提取特征 - Extracting Features from a SavedModel via Keras 2.4.3 and Tensorflow 2.2 ModuleNotFoundError:没有名为 &#39;keras_preprocessing&#39; tensorflow2.2 的模块与 pip - ModuleNotFoundError: No module named 'keras_preprocessing' tensorflow2.2 with pip 如何安装 TensorFlow 2.2 版? - How can I install TensorFlow version 2.2?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM