欢迎光临
我们一直在努力

TensorFlow低版本代码自动升级为1.0版本

TensorFlow 1.x 不提供向后兼容性。这意味着在 TensorFlow 0.x 上运行的代码可能无法在 TensorFlow 1.0 上运行。因此,如果代码是用 TensorFlow 0.x 框架编写的,你需要升级它们(旧的 GitHub 存储库或你自己的代码)。

这一节将指出 TensorFlow 0.x 和 TensorFlow 1.0 之间的主要区别,并展示如何使用脚本 tf_upgrade.py 自动升级 TensorFlow 1.0 的代码。

具体做法

  1. 从网址 https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/compatibility 下载 tf_upgrade.py。
  2. 如果要将一个文件从 TensorFlow 0.x 转换为 TensorFlow 1.0,请在命令行使用以下命令:



     

赞(0) 打赏
未经允许不得转载:hosteons中文网 » TensorFlow低版本代码自动升级为1.0版本

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册