tensorflow导入keras出错问题

在升级tensorflow到2.10.1过程中,出现keras导入时出错问题,在网上进行了几个小时的搜索,没有找到好的解决方案。大体的解决思路是tensorflow与keras的版本不兼容。实际问题解决后,确实是这个原因。在网上查找的tensorflow对应的版本都比较低,这里可以使用的版本是:tensorflow为2.10.1,keras的版本为2.10.0。先安装keras, 再安装tensorflow。

pip install keras=2.10.0

pip install tensorflow==2.10.1

安装的结果:

Installing collected packages: tensorflow-estimator, tensorboard-data-server, google-auth-oauthlib, tensorboard, tensorflow
  Attempting uninstall: tensorflow-estimator
    WARNING: Ignoring invalid distribution -rotobuf (c:\users\he\.conda\envs\tf2\lib\site-packages)
    Found existing installation: tensorflow-estimator 2.11.0
    Uninstalling tensorflow-estimator-2.11.0:
      Successfully uninstalled tensorflow-estimator-2.11.0
  Attempting uninstall: tensorboard-data-server
    Found existing installation: tensorboard-data-server 0.7.0
    Uninstalling tensorboard-data-server-0.7.0:
      Successfully uninstalled tensorboard-data-server-0.7.0
  Attempting uninstall: google-auth-oauthlib
    Found existing installation: google-auth-oauthlib 1.0.0
    Uninstalling google-auth-oauthlib-1.0.0:
      Successfully uninstalled google-auth-oauthlib-1.0.0
  Attempting uninstall: tensorboard
    Found existing installation: tensorboard 2.13.0
    Uninstalling tensorboard-2.13.0:
      Successfully uninstalled tensorboard-2.13.0
  Attempting uninstall: tensorflow
    Found existing installation: tensorflow 2.11.1
    Uninstalling tensorflow-2.11.1:
      Successfully uninstalled tensorflow-2.11.1


Successfully installed google-auth-oauthlib-0.4.6 tensorboard-2.11.2 tensorboard-data-server-0.6.1 tensorflow-2.10.1 tensorflow-estimator-2.10.0


 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值