我正在尝试使用 Keras 设置梯度下降过程,但我不断收到错误消息:
from keras import backend as K
grads = K.gradients(loss, combination_image)[0]
fetch_loss_and_grads = K.function([combination_image], [loss, grads])
这是我的错误信息:
tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.