vturrisi / solo-learn

solo-learn: a library of self-supervised methods for visual representation learning powered by Pytorch Lightning
MIT License
1.43k stars 186 forks source link

Some errors occurred after adding ConvNeXt #226

Closed yifeiwang77 closed 2 years ago

yifeiwang77 commented 2 years ago
  1. I still encounter ModuleNotFoundError: No module named 'timm.models.convnext' after pip install timm
  2. When disabling importing convnext, I further encounter TypeError: __init__() got an unexpected keyword argument 'img_size' after running the simclr script with cifar10 argument. This img_size argument seems to be introduced by adding convnext while causing errors with original ones. I fix it by copying "resnet" not in args.backbone and from Line 254 to Line 199 in solo/args/utils.py.

Environment: Python 3.6 with package versions following requirements.txt.

vturrisi commented 2 years ago

Hi. Thanks for letting us know. The issue was an if instead of an elif, which should now be fixed. About 1, convnext was added very recently to timm, so you probably have an outdated package. I suggest just updating it with pip install timm -U.