1 在代码中添加这样一句:
tf.compat.v1.disable_eager_execution()
2 在代码中所有用 placeholder的地方修改为
tf.compat.v1.placeholder
参考
https://blog.youkuaiyun.com/weixin_43763859/article/details/104537392
禁用TensorFlow急切执行
本文介绍如何在TensorFlow代码中禁用急切执行模式,通过使用tf.compat.v1.disable_eager_execution()函数,并将所有placeholder更新为tf.compat.v1.placeholder,确保代码在不同版本间的兼容性。
1 在代码中添加这样一句:
tf.compat.v1.disable_eager_execution()
2 在代码中所有用 placeholder的地方修改为
tf.compat.v1.placeholder
参考
https://blog.youkuaiyun.com/weixin_43763859/article/details/104537392
3647
948
684
2万+

被折叠的 条评论
为什么被折叠?