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.26k stars 334 forks source link

TypeError: register_transform() got an unexpected keyword argument 'bypass_checks' #431

Closed doulemint closed 3 years ago

doulemint commented 3 years ago

1.run command

python nearest_neighbor_test.py config=benchmark/nearest_neighbor/eval_resnet_8gpu_in1k_kNN \
  config.MODEL.WEIGHTS_INIT.PARAMS_FILE="/content/resnet50-19c8e357.pth"

full log:

Traceback (most recent call last):
  File "nearest_neighbor_test.py", line 16, in <module>
    from vissl.hooks import default_hook_generator
  File "/content/vissl/vissl/hooks/__init__.py", line 12, in <module>
    from vissl.hooks.dino_hooks import DINOHook
  File "/content/vissl/vissl/hooks/dino_hooks.py", line 17, in <module>
    from vissl.models import build_model
  File "/content/vissl/vissl/models/__init__.py", line 6, in <module>
    from vissl.models.base_ssl_model import BaseSSLMultiInputOutputModel
  File "/content/vissl/vissl/models/base_ssl_model.py", line 15, in <module>
    from vissl.data.collators.collator_helper import MultiDimensionalTensor
  File "/content/vissl/vissl/data/__init__.py", line 26, in <module>
    from vissl.data.ssl_dataset import GenericSSLDataset
  File "/content/vissl/vissl/data/ssl_dataset.py", line 15, in <module>
    from vissl.data.ssl_transforms import get_transform
  File "/content/vissl/vissl/data/ssl_transforms/__init__.py", line 34, in <module>
    import_all_modules(FILE_ROOT, "vissl.data.ssl_transforms")
  File "/usr/local/lib/python3.7/dist-packages/classy_vision/generic/registry_utils.py", line 20, in import_all_modules
    importlib.import_module(module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/content/vissl/vissl/data/ssl_transforms/rand_auto_aug.py", line 75, in <module>
    @register_transform("RandAugment", bypass_checks=True)
TypeError: register_transform() got an unexpected keyword argument 'bypass_checks'

Expected behavior:

I add sys.path.insert(0,'/content/vissl') in order to import from vissl.config import AttrDict but using vissl library from the current github code rather than visssl library from pip install leads to this TypeError happen. it seems has inconsistency issue between the current github code and pip-installed version

Environment:

pytorch 1.7
doulemint commented 3 years ago

Does anyone try to run tools/nearest_neighbor_test.py?

prigoyal commented 3 years ago

Hi @doulemint , this is coming due to classy vision, can you pip uninstall classy_vision and install using the steps https://github.com/facebookresearch/vissl/blob/main/INSTALL.md#step-4-install-vissl ? the change is that master branch was renamed to main recently.

doulemint commented 3 years ago

Ok. It's finally able to run. Save my life, thank you.