简体   繁体   中英

keras installed but doesn't have subsequent functions

I installed keras 2.2.4 and tensorflow 1.12.0 in my Win10 computer. From Anaconda navigator screen, it seems all needed ones were installed. 在此处输入图像描述

在此处输入图像描述 However, my keras doesn't have any subsequent functions (eg keras.model or keras.layers). When I import keras , it can work, but if I changed to import keras.models or from keras.models import Sequential , it said ModuleNotFoundError: No module named 'keras.models' . All other subsequent ones like keras.layers or keras.datasets didn't work either.

Thanks for the help.

With the versions mentioned by you,

'import keras.models' or 'from keras.models import Sequential' works fine.

Just to confirm I installed keras and tensorflow in the new environment and it was working fine.

Try reinstalling the packages using pip and check once. It should work.

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