简体   繁体   中英

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. But when I tried importing keras, it is giving the the error of Module not found. Also the error statements show the error is at a line inside keras at import tensorflow as tf . How to make keras import tensorflow-gpu instead of 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. Don't know what had went wrong. Maybe the installation was not proper first time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM