Solved by MariosOreo in post #8 
              
              
                Oh, it is too stupid. 
In my method transforms, I made mistakes mask = resize(image), so that in the DataLoader the dimension mismatch error will occur in the default_collate, it is not the DataLoader’s problem. 
My code as follows: 
rgb_mean = (0.4353, 0.4452, 0.4131)
rgb_std = (0.2044, 0.1924, 0.2…