colab是google提供的免费运行机器学习的平台
https://colab.research.google.com/notebooks/intro.ipynb

上来就失败了。AttributeError: module ‘tensorflow’ has no attribute ‘global_variables_initializer’
使用colab运行<机器学习实战>上代码失败问题
原因:当前colab平台默认的tf是2*版本,机器学习实战书上所用的版本是tf 1*版本

解决方法:看了下2*的文档,感觉直接入手有难度,决定将colab默认tf版本退回到1.。
%tensorflow_version 1.x
使用colab运行<机器学习实战>上代码失败问题

注意要重新启动,不然版本切换会不生效
使用colab运行<机器学习实战>上代码失败问题

相关文章:

  • 2021-12-27
  • 2021-12-21
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-12-20
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2021-08-26
  • 2021-06-18
  • 2021-11-14
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案