tf_chatbot_seq2seq_antilm icon indicating copy to clipboard operation
tf_chatbot_seq2seq_antilm copied to clipboard

--reinforce_learn doesn't work!

Open SeekPoint opened this issue 8 years ago • 4 comments

SeekPoint avatar Jun 07 '17 06:06 SeekPoint

On CPU setting: after the following changes: @@ -331,7 +332,9 @@ class Seq2SeqModel(object): while True: #----[Step]---------------------------------------- encoder_state, step_loss, output_logits = self.step(session, encoder_inputs, decoder_inputs, target_weights,

  •                      bucket_id, training=False, force_dec_input=False)
    
  •                      bucket_id, forward_only=False, force_dec_input=False)
    

and

@@ -395,7 +399,7 @@ class Seq2SeqModel(object):

 # step
 _, _, output_logits = self.step(session, encoder_inputs, decoder_inputs, target_weights,
  •                    bucket_id, training=False, force_dec_input=True)
    
  •                    bucket_id, forward_only=False, force_dec_input=True)
    

I still got at function logits2tokens:

Creating 4 layers of 256 units. Created model with fresh parameters. Reading development and training data (limit: 0). reading data line 100000 reading data line 200000 [INPUT]: [b'\xe8\xae\x93', b'\xe4\xbd\xa0', b'\xe8\xbd\x89\xe9\x81\x8e', b'\xe8\xba\xab\xe8\x83\x8c', b'\xe5\xb0\x8d', b'\xe8\x91\x97', b'\xe6\x88\x91', b'\xe7\x82\xba', b'\xe4\xbd\xa0', b'\xe7\xb9\xab', b'\xe4\xb8\x8a', b'\xe6\x88\x91', b'\xe7\x9a\x84', b'\xe6\x89\xbf', b'\xe8\xab\xbe', b'_PAD', b'_PAD', b'_PAD', b'_PAD', b'_PAD'] output_logits is: None Traceback (most recent call last): File "main.py", line 28, in tf.app.run() File "/ve_tf1.0_py3/venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 18, in main train(args) File "/ve_tf1.0_py3/tf_chatbot_seq2seq_antilm---ori/lib/train.py", line 83, in train target_weights, bucket_id, rev_vocab=rev_vocab) File "/ve_tf1.0_py3/tf_chatbot_seq2seq_antilm---ori/lib/seq2seq_model.py", line 347, in step_rf resp_tokens, resp_txt = self.logits2tokens(output_logits, rev_vocab, sent_max_length) File "/ve_tf1.0_py3/tf_chatbot_seq2seq_antilm---ori/lib/seq2seq_model.py", line 414, in logits2tokens tokens = [int(np.argmax(t, axis=1)) for t in logits] TypeError: 'NoneType' object is not iterable

SeekPoint avatar Jun 14 '17 10:06 SeekPoint

did you get something about --reinforce_learn not work ?

yogesh-0586 avatar Jun 14 '17 18:06 yogesh-0586

@yogesh-0586 still struggling

SeekPoint avatar Jun 15 '17 01:06 SeekPoint

For first "step()" (original)one of parameter : training =False, which means do the predict , that is , forward_only=True however, I don't know whether the "force_dec_input" should be set True or False. i am working on the reinforce_learn too.

dollyk avatar Jun 23 '17 08:06 dollyk