I’m not sure how many samples your Dataset has, but probably the last batch is smaller than the specified batch_size.
I would recommend to use the batch dimension flexible and rather specify the feature dimensions:
x1 = x1.view(-1, 20)
x2 = pose.view(-1, 34)

This makes sure your code is also working with varying batch sizes.