Closed gidim closed 7 years ago
Same here.
Set the batch size as 1, then it works.
I had no success with that. The code in chat.py has it already set: model = create_model(sess, args) model.batch_size = 1 # We decode one sentence at a time. When passing batch_size as command line parameter --batch_size 1 I'm getting the prompt ">" but as soon I submit something I'm getting the following error:
Traceback (most recent call last):
File "main.py", line 28, in
TypeError: only integer scalar arrays can be converted to a scalar index
change the line to: return rev_vocab[out[0]]
That worked for me. Will submit a pull request.
I'm now getting some output but even though I trained until perplexity was below 40 it looks like there is an issue with the output. (twitter corpus)
are you kidding me? [{'prob': 2.5728970049210626e-62, 'dec_inp': '_GO levee 34-year 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5728970049210626e-62}, {'prob': 2.5720786921651683e-62, 'dec_inp': '_GO levee 34-year 34-year 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5720786921651683e-62}, {'prob': 2.5607476792239287e-62, 'dec_inp': '_GO levee 34-year too‼️ 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5607476792239287e-62}, {'prob': 2.5607317645238776e-62, 'dec_inp': '_GO levee 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5607317645238776e-62}, {'prob': 2.5599072436347957e-62, 'dec_inp': '_GO levee 34-year 34-year 34-year 34-year 34-year 34-year [holds 34-year [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5599072436347957e-62}, {'prob': 2.559747353973062e-62, 'dec_inp': '_GO levee 34-year 34-year 34-year 34-year 34-year 34-year 34-year [holds 34-year [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.559747353973062e-62}, {'prob': 2.5597117609238067e-62, 'dec_inp': '_GO levee 34-year too‼️ 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5597117609238067e-62}, {'prob': 2.5589409628891065e-62, 'dec_inp': '_GO levee 34-year 34-year 34-year 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5589409628891065e-62}, {'prob': 2.5589247934087181e-62, 'dec_inp': '_GO levee too‼️ 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.5589247934087181e-62}, {'prob': 2.557861740562856e-62, 'dec_inp': '_GO levee too‼️ 34-year 34-year 34-year 34-year 34-year 34-year 34-year [holds [holds [holds [holds [holds', 'eos': False, 'prob_t': 0, 'prob_ts': 2.557861740562856e-62}]
Do you have any recommendation what the issue could be?
@joa23, I believe the issue is that when you run main.py with chat mode, it creates a fresh model with default parameters. It should take the trained model, but that doesn't happen here it seems. The reason might be the way the checkpoint is fetched (it doesn't find the latest checkpoint in folder, and so it creates a fresh model). I was facing the same issue, and narrowed down the problem to the one I mentioned. But couldn't really had any time to fix. Will post the solution here once done. Meanwhile check if you can fix.
@ajaymaity Thanks for the hint. I will try to investigate as well.
@ajaymaity is right, whatever parameter you appended in main.py command while in training, you have to append exactly the same while you do testing. Will add this to the readme.
Model was training fine. This is what happens when i launch:
python3 main.py --mode chat