[英]keras installed but doesn't have subsequent functions
I installed keras 2.2.4 and tensorflow 1.12.0 in my Win10 computer.我在我的 Win10 电脑上安装了 keras 2.2.4 和 tensorflow 1.12.0。 From Anaconda navigator screen, it seems all needed ones were installed.
从 Anaconda 导航屏幕,似乎所有需要的都安装了。
However, my keras doesn't have any subsequent functions (eg keras.model or keras.layers).
但是,我的 keras 没有任何后续功能(例如 keras.model 或 Z063009BB15C8272BD0C701)。 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' .当我
import keras
时,它可以工作,但是如果我更改为import keras.models
或from keras.models import Sequential
,它说ModulesNotFoundError: No. All other subsequent ones like keras.layers or keras.datasets didn't work either.所有其他后续的,如 keras.layers 或 keras.datasets 也不起作用。
Thanks for the help.谢谢您的帮助。
With the versions mentioned by you,使用您提到的版本,
'import keras.models' or 'from keras.models import Sequential' works fine. 'import keras.models' 或 'from keras.models import Sequential' 工作正常。
Just to confirm I installed keras and tensorflow in the new environment and it was working fine.只是为了确认我在新环境中安装了 keras 和 tensorflow 并且工作正常。
Try reinstalling the packages using pip and check once.尝试使用 pip 重新安装软件包并检查一次。 It should work.
它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.