I tried running python eval.py as mentioned in README.md and ran into RuntimeError: Expected object of backend CUDA but got backend CPU for argument #3 'index. I managed to solve this by looking at the train.py and replacing
sentence, len_sentence, question = batch.src[0], batch.src[1], batch.trg[0]
with
sentence, len_sentence, question = batch.src[0].to(device), batch.src[1].to(device), batch.trg[0].to(device)
But now I have another problem. I debugged the code and found out that the evaluation loop runs for 4 iterations and it prints a lot of <unk>s but on the 5th iteration, it doesn't go beyond the line:
pred = model(sentence, len_sentence, answer=answer)
It is stuck forever in the loop. I'm new to this and I'm trying to learn how this works by looking at your code. Please help.
I tried running
python eval.pyas mentioned in README.md and ran intoRuntimeError: Expected object of backend CUDA but got backend CPU for argument #3 'index. I managed to solve this by looking at thetrain.pyand replacingwith
But now I have another problem. I debugged the code and found out that the evaluation loop runs for 4 iterations and it prints a lot of
<unk>s but on the 5th iteration, it doesn't go beyond the line:It is stuck forever in the loop. I'm new to this and I'm trying to learn how this works by looking at your code. Please help.