AttributeError: module ‘tensorflow’ has no attribute ‘X’.
:关于模块“tensorflow”没有属性“X”的问题
问题原因:
因为tensorflow2.0以后,有了很大的整改,对模块没有属性问题
只是一个方法就可以解决
问题解决:
第一种方法:
import tensorflow as tf
调用属性时:
tf.compat.v1.属性
第二种方法:
import tensorflow.compat.v1 as tf
调用属性时:
tf.属性
可用性可参考下列博客:
https://blog.csdn.net/qq_43279647/article/details/105022516
https://blog.csdn.net/qq_43279647/article/details/105022690
https://blog.csdn.net/qq_43279647/article/details/105025034