[英]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.