这个错误是因为 TensorFlow 2.x 版本中已经没有 reset_default_graph() 方法了。如果你正在使用 TensorFlow 2.x 版本,那么你可以删除这行代码,因为默认情况下 TensorFlow 2.x 会自动重置默认图。如果你正在使用 TensorFlow 1.x 版本,那么你需要使用 tf.compat.v1.reset_default_graph() 方法来重置默认图。

TensorFlow 2.x 错误:AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

原文地址: https://www.cveoy.top/t/topic/mNHS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录