AttributeError: ‘RefVariable‘ object has no attribute ‘_id‘--使用Tensorflow2.0版本(及時執行模式)

在使用tensorflow2.0版本的框架時,一般默認爲即使執行模式。但有時候還是像tensorflow1.x版本一樣,必須在導入庫函數之後,調用函數:tf.enable_eager_execution()才能啓用及時執行模式,否則會導致如下類似錯誤。 一般遇到上述問題,只需要在import tensorflow as tf 的語句後面加上: tf.enable_eager_execution()
相關文章
相關標籤/搜索