我正在使用Tensorflow 2.3.0 对于代码
import tensorflow as tf
y_N= tf.Variable([1., 2., 3.],name="dd")
cost = -tf.reduce_mean(input_tensor=tf.reduce_sum(input_tensor=tf.math.log(y_N), axis=0))
loss=lambda:cost
train_step = tf.keras.optimizers.Adam(0.5).minimize(loss, var_list=[y_N])
我出错了
ValueError: No gradients provided for any variable: ['dd:0'].
如何解决?