AttributeError: module ‘tensorflow’ has no attribute ‘reset_default_graph’
原因:
因为安装的Tensorflow 2不支持Tensorflow1的API而报的错
原本的代码:
import tensorflow as tf
更改后的代码:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
AttributeError: module ‘tensorflow’ has no attribute ‘reset_default_graph’
原因:
因为安装的Tensorflow 2不支持Tensorflow1的API而报的错
原本的代码:
import tensorflow as tf
更改后的代码:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()