0
我想在我的seq2seq模型中獲得GRUCell激活。基本上以translate.py爲例,我試圖看看單元格是如何被激活的。我已經試過這要打印的張數的改變,但是我沒有任何運氣拉GRUCell激活
test = tf.get_default_graph().get_tensor_by_name("model_with_buckets/embedding_attention_seq2seq/RNN/MultiRNNCell_35/Cell2/GRUCell/add:0")
print(test.eval())
我不斷收到此錯誤:
InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'encoder0' with dtype int32
[[Node: encoder0 = Placeholder[dtype=DT_INT32, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
我試圖創造「encoder0」變量和傳球它的eval(feed_dict=encoder)
encoder = tf.placeholder(tf.int32, (len(encoder_inputs), 1),'encoder0')
enc_data = tf.Variable(encoder, trainable=False, collections=[])
sess.run(enc_data.initializer, feed_dict={encoder:encoder_inputs})