chenxi116 / DeepLabv3.pytorch

PyTorch implementation of DeepLabv3
Other
253 stars 47 forks source link

Scaling the data while training the model is giving following error #21

Closed prk-vinay closed 3 years ago

prk-vinay commented 3 years ago

I am getting following error when I preprocess the data with scaling option: RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 518 and 338 in dimension 2 at /pytorch/aten/src/TH/generic/THTensor.cpp:711

When I set scaling=None, model trains properly. I searched online and found out that scaling the images in a batch randomly will result in different Height and Width for each image, and hence, we will have to write and pass a custom collate function to dataloader. Has anyone else also faced the same issue?