Deeprl-agents: DRQN: Tensor awalan kesalahan harus berupa skalar atau vektor

Dibuat pada 13 Jul 2017  ·  3Komentar  ·  Sumber: awjuliani/DeepRL-Agents

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)

---- Terjadi kesalahan pada baris ini-------

self.state_in = rnn_cell.zero_state(self.batch_size, tf.float32)

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.

Semua 3 komentar

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.

Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

IbrahimSobh picture IbrahimSobh  ·  10Komentar

IbrahimSobh picture IbrahimSobh  ·  30Komentar

AuCson picture AuCson  ·  3Komentar

jamiehannaford picture jamiehannaford  ·  3Komentar

disimone picture disimone  ·  3Komentar