the input of your network should be 5D, first dimension is the size of your batch, second the dimension of data and last 3 related to the 3D data. So I don’t see why you unsqueeze in the first place if you already have 5 dimensions.