Closed marxmit7 closed 5 years ago
Hi, I solved it by modifying the code as below
if total_predict_count > 0:
perplexity = utils.safe_exp(total_loss / total_predict_count)
else:
perplexity = 0
I have done the training process and the model for Inference performs really well. But the thing is, by doing so, we will get
eval test: perplexity 0.00
and the output_test will be empty By the way, there is also a ZeroDivisionError in bleu.py and I changed likewise.
Fixed, pull request has been made
File "nmt/model_helper.py", line 444, in compute_perplexity perplexity = utils.safe_exp(total_loss / total_predict_count) ZeroDivisionError: integer division or modulo by zero