当前位置:   article > 正文

TensorFlow 安装遇到的问题 AttributeError: module 'tensorflow' has no attribute 'keras'

attributeerror: module 'tensorflow' has no attribute 'keras

 

  • tensorflow 装好后运行 samples里面的例子
python3 premade_estimator.py
  • 报错:AttributeError: module 'tensorflow' has no attribute 'keras'
pip3 install keras
  • 装keras 还是出现上述问题。
  • 更新tensorflow:
conda update tensorflow

导入tensorflow报错: illlegal instruction, 然后python界面直接退出了。

难道是版本不对,按照下面这个网址做试试看!

pip3 uninstall tensorflow
pip3 install -Iv tensorflow==1.5
我是直接输入:pip3 install tensorflow==1.5
导入没问题了。

运行官网给的例子

python premade_estimator.py

 

  • 如果报错说缺啥module就重新装一下就行,即使用pip list 看了存在,还有可能是缺少一些依赖modules。

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/225048
推荐阅读
相关标签
  

闽ICP备14008679号