解决问题:module ‘tensorflow‘ has no attribute ‘reset_default_graph‘

import tensorflow as tf

错误:

module 'tensorflow' has no attribute 'reset_default_graph'

解决方案:

tf.reset_default_graph()

改为

tf.compat.v1.reset_default_graph()

你可能感兴趣的:(python)