neural-template-gen
neural-template-gen copied to clipboard
IndexError occurs when generation
When I using your code to run a chinese dataset(the format is the same as wikibio dataset), some error occurs during generation part--"IndexError: index 574664924280828 is out of range for dimension 0 (of size 5)", and I find that it occurs because "maxprobs, top2k = torch.topk(wrd_dist.view(-1), 2 * K)" the top2k are all nan elements. I debug this for a long time but can not solve it, so how can I deal with it?
Traceback (most recent call last):
File "/home/h50001979/.pycharm_helpers/pydev/pydevd.py", line 1758, in
I you're getting nans, then presumably wrd_dist
, which should contain log probabilities, contains nans, so I would recommend trying to figure out how that's happening. Is it possible that somehow you're getting negative numbers on line 507, which become nan after the log on line 513?
Yeah, thanks a lot! You are totally right, I'm getting negative numbers on line 507, which become nan after the log on line 513, but I don't know why this happens =.=. Is there any recommended solution?
@ZJUhjx How did you turn Chinese dataset to the format same as wikibio. And did you successfully apply this project to Chinese dataset?