Hey @aerinykim and @albanD,
I’m running into a similar issue. Getting exactly the same RuntimeError.
This is the code I’m trying to run:https://github.com/jamie-murdoch/ContextualDecomposition/blob/master/train_model/train.py 9
I’m running into the error at line 78, where we train the model:
# forward pass
answer = model(batch)

Not understanding why batch is not on GPU though we set the device in the code.
Also how do we move batch to GPU? cuda() and to(device) methods aren’t defined for batch (<class torchtext.data.batch.Batch>).
Please help! I’m stuck with this from the past few days