我正在使用 Keras 后端函数来计算强化学习设置中的梯度,以下是代码片段。对于此代码,我也收到以下错误。可能是什么原因?
1 X = K.placeholder(shape=(None, 32, 32, 3))
2 train_fxn = K.function([X], [], updates=updates)
3 X = self.states[0].reshape(1, 32, 32, 3)
4 train_fxn([X])
错误是
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'sequential_2_input_1' with dtype float and shape [?,32,32,3]
[[Node: sequential_2_input_1 = Placeholder[dtype=DT_FLOAT, shape=[?,32,32,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]