once-for-all icon indicating copy to clipboard operation
once-for-all copied to clipboard

KeyError: <InterpolationMode.BILINEAR: 'bilinear'>

Open talenz opened this issue 2 years ago • 4 comments

when running train_ofa_net.py

torch 1.11.0 torchvision 0.12.0

talenz avatar May 17 '22 02:05 talenz

I've had this problem, too.

Shadow1300 avatar Aug 11 '22 09:08 Shadow1300

Me, too.

LiangLiu-ic avatar Aug 18 '22 11:08 LiangLiu-ic

Same here:

Error:

(once-for-all) $ python train_ofa_net.py
...
File ".../once-for-all/ofa/utils/my_dataloader/my_random_resize_crop.py", line 86, in __repr__
    interpolate_str = _pil_interpolation_to_str[self.interpolation]
KeyError: <InterpolationMode.BILINEAR: 'bilinear'>

Env:

...
torch              1.12.1
torchvision        0.13.1
...

izenderi avatar Oct 26 '22 00:10 izenderi

I fix that use comment line 87 to line 97 or set config value interpolate_str in line 87 like that:

interpolate_str = _pil_interpolation_to_str[self.interpolation]

change to:

interpolate_str = "PIL.Image.BILINEAR"

I think they wrong in config str, so I think fix that not impact in training

C0NGTRI123 avatar Feb 16 '24 10:02 C0NGTRI123