Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--reinforce_learn doesn't work! #22

Open
SeekPoint opened this issue Jun 7, 2017 · 4 comments
Open

--reinforce_learn doesn't work! #22

SeekPoint opened this issue Jun 7, 2017 · 4 comments

Comments

@SeekPoint
Copy link

No description provided.

@SeekPoint SeekPoint changed the title --reinforce_learn doesn't work at all --reinforce_learn doesn't work! Jun 14, 2017
@SeekPoint
Copy link
Author

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

@yogesh-0586
Copy link

did you get something about --reinforce_learn not work ?

@SeekPoint
Copy link
Author

@yogesh-0586
still struggling

@dollyk
Copy link

dollyk commented Jun 23, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants