使用TensorFlow问题解决——AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
AttributeError: module 'tensorflow' has no attribute 'placeholder'报错原因是再tf2下使用了tf1的API需要将原来的import tensorflow as tf用如下代码进行替换import tensorflow.compat.v1 as tftf.disable_v2_behavior()
·
AttributeError: module 'tensorflow' has no attribute 'placeholder'
报错原因是再tf2下使用了tf1的API
需要将原来的
import tensorflow as tf
用如下代码进行替换
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
更多推荐



所有评论(0)