报错信息如下:
后来发现还有这样的错误
RuntimeError: Attempting to capture an EagerTensor without building a function.(也是通过下面方式解决了)
这种错误还是导入tensorflow的问题
import tensorflow as tf
改为下面这种应该就没什么问题了
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
报错信息如下:
后来发现还有这样的错误
RuntimeError: Attempting to capture an EagerTensor without building a function.(也是通过下面方式解决了)
这种错误还是导入tensorflow的问题
import tensorflow as tf
改为下面这种应该就没什么问题了
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()