RuntimeError: The Session graph is empty. Add operations to the graph before calling run().解決方法

問題產生的緣由:沒法執行sess.run()的緣由是tensorflow版本不一樣致使的,tensorflow版本2.0沒法兼容版本1.0. 解決辦法: tf.compat.v1.disable_eager_execution()web import tensorflow as tf tf.compat.v1.disable_eager_execution() #保證sess.run()可以正常運
相關文章
相關標籤/搜索