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,请在命令行使用以下命令:



     

本文标题:TensorFlow低版本代码自动升级为1.0版本

本文地址:https://www.hosteonscn.com/4204.html

评论

0条评论

发表评论

邮箱地址不会被公开。 必填项已用*标注