Problem solving --AttributeError: module 'tensorflow' has no attribute 'placeholder'

Analysis: Using the tf1 tf2 in the API

Solution: 

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

Replace the original

1 import tensorflow as tf

 

Guess you like

Origin www.cnblogs.com/AmeliaWu2019/p/11936064.html