tensorflow keras 问题汇总

1. AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

问题原因:tf 和 keras 版本不匹配,具体匹配,可参考:https://blog.csdn.net/weixin_40109345/article/details/106730050

安装指定版本,比如tensorflow1.9.0对应keras版本2.2.0,

操作:pip install keras==2.2.0

安装后查看kears版本是否正确:import keras         keras.__version__

 

 

anaconda3.5(内置python3.6),tf-gpu 1.8.0,pip安装的时候出现两个错误:

  (1)Invalid requirement: '=='

    等号不能识别,需要 额外安装包 pyls

  在cmd检查是否安装过pyls,命令:import pyls

  如果没有版本信息,就是用 pip install pyls安装即可

参考:https://blog.csdn.net/King_W_G/article/details/103019448

  (2)TypeError: parse() got an unexpected keyword argument 'transport_encoding'

造成原因不确定,解决方法,依次输入以下命令尝试:

  1)conda install -c anaconda html5lib

  2)conda install pip
  3)打开对应安装 文件夹Anaconda3\Lib\site-packages\pip\index.py文件,将第730行 ‘transport_encoding=encoding’注释掉

参考:https://blog.csdn.net/lzw17750614592/article/details/85019330

 

posted @ 2020-11-02 20:24  zhshining  阅读(512)  评论(0编辑  收藏  举报