看見在以下this tutorial,我收到以下錯誤:DRQN - 前綴張量必須是一個標量或矢量,但張量
ValueError: prefix tensor must be either a scalar or vector, but saw tensor: Tensor("Placeholder_2:0", dtype=int32)
誤差從這些線來源:
# Take the output from the final convolutional layer and send it to a recurrent layer
# The input must be reshaped into [batch x trace x units] for rnn processing, and then returned to
# [batch x units] when sent through the upper levels
self.batch_size = tf.placeholder(dtype=tf.int32)
self.convFlat = tf.reshape(slim.flatten(self.conv4), [self.batch_size, self.trainLength, h_size])
# !!!!This is the line where error city happens!!!!
self.state_in = rnn_cell.zero_state(self.batch_size, tf.float32)
網絡初始化後:
mainQN = Qnetwork(h_size, cell, 'main')
當在python控制檯中單獨運行代碼時,該錯誤仍然存在,因此錯誤是一致的。
我會發布更多的代碼,如果這將是有益的