查看tf版本,是因为在tf2下使用了tf1的API。
解决方式:
使用
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
替换
import tensorflow as tf
AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
最新推荐文章于 2024-03-15 10:05:58 发布
查看tf版本,是因为在tf2下使用了tf1的API。
解决方式:
使用
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
替换
import tensorflow as tf