问题解决——AttributeError: module 'tensorflow' has no attribute 'placeholder'

问题分析:在tf2下使用了tf1的API

解决方法: 

1 import tensorflow.compat.v1 as tf
2 tf.disable_v2_behavior()

替换掉原本的

1 import tensorflow as tf

 

posted on 2019-11-26 15:49  yuanyuanWu11  阅读(18159)  评论(0)    收藏  举报