Trying to run my own dataset that has 375x500 images.
However, I keep blowing up during batch creation with
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py",
line 55, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0.
Got 500 and 375 in dimension 2 at /pytorch/aten/src/TH/generic/THTensor.cpp:612
Is the issue that my images are not square? I see that camvid images are 960x720 so was assuming that should be ok as it can just pad it out.
Or is issue that images are odd (375px) rather than even (ala 376?).
If I use the aug_transforms with size = 187,500
batch_tfms=[*aug_transforms(size=(187,250)),Normalize.from_stats(*imagenet_stats)])
it will make a batch but then when I make a learner, it blows up with similar error:
/fastai2/fastai2/fastai2/data/load.py in fa_collate(t)
43 def fa_collate(t):
44 b = t[0]
---> 45 return (default_collate(t) if isinstance(b, _collate_types)
46 else type(t[0])([fa_collate(s) for s in zip(*t)]) if isinstance(b, Sequence)
47 else default_collate(t))
~/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py in default_collate(batch)
53 storage = elem.storage()._new_shared(numel)
54 out = elem.new(storage)
---> 55 return torch.stack(batch, 0, out=out)
56 elif elem_type.__module__ == 'numpy' and elem_type.__name__ != 'str_' \
57 and elem_type.__name__ != 'string_':
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 500 and 375 in dimension 2 at /pytorch/aten/src/TH/generic/THTensor.cpp:612
I’ll keep trying to debug but if anyone has input would appreciate it!