facebookresearch / vissl

VISSL is FAIR's library of extensible, modular and scalable components for SOTA Self-Supervised Learning with images.
https://vissl.ai
MIT License
3.25k stars 331 forks source link

Example notebook Using_a_pretrained_model_for_inference error with TRUNK_PARAMS #424

Closed jshaffer94247 closed 2 years ago

jshaffer94247 commented 3 years ago

Instructions To Reproduce the 🐛 Bug:

Example notebook Using_a_pretrained_model_for_inference does not run in my local environment. If downloaded as-is, the first crash occurs with the line model = build_model(cfg.config.MODEL, cfg.config.OPTIMIZER) which reports the error

---> 67         self.trunk_config = self.model_config.TRUNK.TRUNK_PARAMS.RESNETS     
68         self.depth = SUPPORTED_DEPTHS(self.trunk_config.DEPTH)     
69         self.width_multiplier = self.trunk_config.WIDTH_MULTIPLIER

What seems to be wrong and my suggestion for how to fix it

If you somehow have the 'master' version of files like vissl/models/trunks/resnext.py, fetch these yaml files as currently shown in the notebook:

!wget -q -O configs/config/simclr/simclr_8node_resnet.yaml https://raw.githubusercontent.com/facebookresearch/vissl/master/configs/config/pretrain/simclr/simclr_8node_resnet.yaml
!wget -q -O vissl/config/defaults.yaml https://raw.githubusercontent.com/facebookresearch/vissl/master/vissl/config/defaults.yaml

If you did a conda or pip install and your vissl.__version__ shows that you have v0.1.5:

wget -q -O configs/config/simclr/simclr_8node_resnet_v015.yaml https://raw.githubusercontent.com/facebookresearch/vissl/v0.1.5/configs/config/pretrain/simclr/simclr_8node_resnet.yaml
wget -q -O vissl/config/defaults_v015.yaml https://raw.githubusercontent.com/facebookresearch/vissl/v0.1.5/vissl/config/defaults.yaml

Note that I've opted to change the name of the file as it is saved locally. This means there are 2 small changes later in the notebook to use the _v015 versions of the yaml files.

config = OmegaConf.load("configs/config/simclr/simclr_8node_resnet_v015.yaml") 
default_config = OmegaConf.load("vissl/config/defaults_v015.yaml")
iseessel commented 3 years ago

Hi @jshaffer94247 yes you are right about all of this. We are going to be cleaning up the tutorials and specifically the versioning in our next minor release.

iseessel commented 2 years ago

Hi @jshaffer94247 sorry for the delay, but all of our tutorials are now fixed and in working order.

You can see: https://vissl.ai/tutorials/Using_a_pretrained_model_for_inference_V0_1_6.