lxtGH / DecoupleSegNets

[ECCV-2020]: Improving Semantic Segmentation via Decoupled Body and Edge Supervision
370 stars 36 forks source link

A suggestion about replaceing transforms.Scale with transforms.Resize #32

Closed IridescentJiang closed 1 year ago

IridescentJiang commented 3 years ago

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.