问题解决——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

猜你喜欢

转载自www.cnblogs.com/AmeliaWu2019/p/11936064.html