tensorflow 版本不同 报错合集
1、
"AttributeError: module 'tensorflow' has no attribute 'random_normal'"问题解决办法
使用
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
替换
import tensorflow as tf
2、tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 196608 values, but the requested shape has 786432 [Op:Reshape]
3、AttributeError: module 'tensorflow' has no attribute 'Session'
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
替换
import tensorflow as tf