在使用tensorflow2.0版本的框架时,一般默认为即使执行模式。但有时候还是像tensorflow1.x版本一样,必须在导入库函数之后,调用函数:tf.enable_eager_execution()才能启用及时执行模式,否则会导致如下类似错误。
AttributeError: ‘RefVariable‘ object has no attribute ‘_id‘--使用Tensorflow2.0版本(及时执行模式)
AttributeError: ‘RefVariable‘ object has no attribute ‘_id‘--使用Tensorflow2.0版本(及时执行模式)
一般遇到上述问题,只需要在import tensorflow as tf 的语句后面加上:
tf.enable_eager_execution()
AttributeError: ‘RefVariable‘ object has no attribute ‘_id‘--使用Tensorflow2.0版本(及时执行模式)
AttributeError: ‘RefVariable‘ object has no attribute ‘_id‘--使用Tensorflow2.0版本(及时执行模式)

相关文章:

  • 2021-07-27
  • 2021-06-21
  • 2021-08-31
  • 2021-12-04
  • 2021-07-25
  • 2021-06-22
  • 2021-06-16
  • 2021-08-06
猜你喜欢
  • 2021-12-15
  • 2022-12-23
  • 2021-11-10
  • 2021-09-15
  • 2021-12-07
  • 2021-12-14
  • 2021-06-06
相关资源
相似解决方案