首页 > 其他 > 详细

TensorFlow2报错:tf.placeholder() is not compatible with eager execution.

时间:2021-04-09 23:47:12      阅读:41      评论:0      收藏:0      [点我收藏+]

 

当我们将TensorFlow1.x中的程序迁移到2.0+版本时,在之前1.x版本中有函数tf.placeholder(),替换成tf.compat.v1.placeholder(),运行时报如下错误:

tf.placeholder() is not compatible with eager execution.

 

解决方案:

在代码前加入下面一行即可:

tf.compat.v1.disable_eager_execution()

 

更多请参见博文:

https://blog.csdn.net/caoyuan666/article/details/104706756   

 

 

TensorFlow2报错:tf.placeholder() is not compatible with eager execution.

原文:https://www.cnblogs.com/huadongw/p/14638206.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!