DecoupleSegNets
DecoupleSegNets copied to clipboard
A suggestion about replaceing transforms.Scale with transforms.Resize
Hi! @lxtGH Thank you for your sharing!
I encoutered the error "stack expects each tensor to be equal size, but got XXX at entry X and YYY at entry Y" when generating best_image while validation in the code "torch.stack(val_visual,0)" in line 228 in utils/misc.py.
I noticed there were a warning mentioned that "The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead."
So, I replaced the "standard_transformers.Scale(384)" in line 207 in utils/misc.py with "standard_transformers.Resize((384,384))".
Then the problem solved.
I suggest that maybe you could modify that to make sure the error does not take place again.