Based on the error message it seems you are using nn.Conv3d in your model, which would expect a 5-dimensional input in the shape [batch_size, channels, depth, height, width], while you are passing a 4-dimensional input. You could either use nn.Conv2d layers or make sure the input has the expected shape.