Could you check the shape of data1 before passing it to the model?
It seems the shape mismatch is created using this tensor.
PS: You don’t need Variables anymore, as they are deprecated since PyTorch 0.4.0.