Skip to content

Cannot evaluate the model #12

Description

@bajracharya-kshitij

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions