It’s a little hard to tell what’s going on here. It would be great if you could find, from your code, a minimal script that demonstrates the RuntimeError.
I think what’s happening is that when batch_size = 1, you might need to unsqueeze the first dimension of your data. For example, if your data is N batches of tensors of size C, then when batch_size=1, the DataLoader might give you a tensor of size C instead of 1, C.