简体   繁体   English

Keras给出错误“ ModuleNotFoundError:没有名为'tensorflow'的模块”,即使安装了tensorflow-gpu

[英]Keras giving error “ModuleNotFoundError: No module named 'tensorflow'” even though tensorflow-gpu is installed

I have tensorflow-gpu and keras installed in Python 3.6.8. 我在Python 3.6.8中安装了tensorflow-gpu和keras。 But when I tried importing keras, it is giving the the error of Module not found. 但是,当我尝试导入keras时,出现了找不到模块的错误。 Also the error statements show the error is at a line inside keras at import tensorflow as tf . 错误语句还显示错误是在import tensorflow as tf keras内部的一行。 How to make keras import tensorflow-gpu instead of tensorflow? 如何使keras导入tensorflow-gpu而不是tensorflow? Do I have to go to the library code and change it? 我是否必须转到库代码并进行更改? Or what else is the solution? 还是其他解决方案?

I just reinstalled both tf and keras and now everything is working fine. 我刚刚重新安装了tf和keras,现在一切正常。 Don't know what had went wrong. 不知道出了什么问题。 Maybe the installation was not proper first time. 也许第一次安装不正确。

暂无
暂无

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

相关问题 Tensorflow-gpu,ModuleNotFoundError:train.py 中没有名为“dataclasses”的模块 - Tensorflow-gpu, ModuleNotFoundError: No module named 'dataclasses' in train.py 具有Keras错误的Tensorflow-gpu - Tensorflow-gpu with Keras Error Windows 10 上的 Tensorflow-gpu 和 Textgenrnn 版本不兼容:ModuleNotFoundError:没有名为“tensorflow.contrib”的模块 - Tensorflow-gpu and Textgenrnn version incompatibility on Windows 10: ModuleNotFoundError: No module named 'tensorflow.contrib' ModuleNotFoundError:没有名为“tensorflow”的模块,即使安装了 tensorflow - ModuleNotFoundError: No module named 'tensorflow', even when tensorflow is installed 即使已经安装了tensorflow-gpu,带有keras软件包的conda bug也会安装tensorflow - conda bug with keras package installs tensorflow even if tensorflow-gpu is already installed Keras安装的Tensorflow会覆盖Tensorflow-GPU安装 - Tensorflow installed by Keras overrides Tensorflow-GPU Installation Windows上的Tensorflow-gpu:ImportError:没有名为_pywrap_tensorflow的模块 - Tensorflow-gpu on windows: ImportError: No module named _pywrap_tensorflow ImportError:没有带有tensorflow-gpu的名为'tensorflow.python'的模块 - ImportError: No module named 'tensorflow.python' with tensorflow-gpu “ModuleNotFoundError:即使安装了模块,也没有名为‘...’的模块 - "ModuleNotFoundError: No module named '…' even though module is installed 回溯错误:ModuleNotFoundError:没有名为“tensorflow.keras”的模块 - Traceback Error: ModuleNotFoundError: No module named 'tensorflow.keras'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM