Saya mencoba DRQN untuk pengamatan parsial, tetapi saya mendapatkan kesalahan:
ValueError: tensor awalan harus berupa skalar atau vektor, tetapi tensor gergaji: Tensor("Placeholder_2:0", dtype=int32)
self.state_in = rnn_cell.zero_state(self.batch_size, tf.float32)
Saya menemukan bahwa ada 3 baris berturut-turut:
self.batch_size = tf.placeholder(dtype=tf.int32)
self.convFlat = tf.reshape(slim.flatten(self.conv4),[self.batch_size,self.trainLength,h_size])
self.state_in = rnn_cell.zero_state(self.batch_size, tf.float32)
Saya mengubah baris:
self.batch_size = tf.placeholder(dtype=tf.int32)
ke dalam:
self.batch_size = tf.placeholder(dtype=tf.int32,shape=[])
Dan itu berhasil.
Terima kasih!!!! Saya pikir pasti kodenya akan hancur, per https://github.com/tensorflow/tensorflow/issues/10213
Tetapi perbaikan ini benar dan berhasil untuk saya juga!
Sangat berharap @awjuliani dapat memperbaiki kode (modifikasi secara harfiah satu baris), terima kasih pak!
Baru saja membuat perubahan! Terima kasih telah menunjukkan ini.
Komentar yang paling membantu
Saya menemukan bahwa ada 3 baris berturut-turut:
self.batch_size = tf.placeholder(dtype=tf.int32)
self.convFlat = tf.reshape(slim.flatten(self.conv4),[self.batch_size,self.trainLength,h_size])
self.state_in = rnn_cell.zero_state(self.batch_size, tf.float32)
Saya mengubah baris:
self.batch_size = tf.placeholder(dtype=tf.int32)
ke dalam:
self.batch_size = tf.placeholder(dtype=tf.int32,shape=[])
Dan itu berhasil.