mit-han-lab / once-for-all

[ICLR 2020] Once for All: Train One Network and Specialize it for Efficient Deployment
https://ofa.mit.edu/
MIT License
1.89k stars 333 forks source link

KeyError: <InterpolationMode.BILINEAR: 'bilinear'> #70

Open talenz opened 2 years ago

talenz commented 2 years ago

when running train_ofa_net.py

torch 1.11.0 torchvision 0.12.0

Shadow1300 commented 2 years ago

I've had this problem, too.

LiangLiu-ic commented 2 years ago

Me, too.

izenderi commented 2 years ago

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
...
C0NGTRI123 commented 9 months ago

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