Are you using an older PyTorch version?
If so, this RuntimeError might be an old error message stating that your batch dimension is missing.
Try to unsqueeze your tensor twice to add the channel and batch dimension.