可以将TensorFlow1.x的代码自动升级成TensorFlow2.x
一、准备
确保安装TensorFlow2.0
二、转换单个python文件
tf_upgrade_v2 --infile xx/xx/xx.py --outfile xx/xx.py
三、目录树的转换
tf_upgrade_v2 --intree xx/xx/xx.py --outtree xx/xx.py
注意
改完后运气好可以立刻用,实际上可能需要进一步修改。
原网页
可以将TensorFlow1.x的代码自动升级成TensorFlow2.x
确保安装TensorFlow2.0
tf_upgrade_v2 --infile xx/xx/xx.py --outfile xx/xx.py
tf_upgrade_v2 --intree xx/xx/xx.py --outtree xx/xx.py
改完后运气好可以立刻用,实际上可能需要进一步修改。
原网页