Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-existent config key when loading EffNets #124

Open
JJGO opened this issue Dec 7, 2020 · 1 comment
Open

Non-existent config key when loading EffNets #124

JJGO opened this issue Dec 7, 2020 · 1 comment

Comments

@JJGO
Copy link

JJGO commented Dec 7, 2020

I'm unable to load the efficient modules. There seems to be an issue with the MODEL.ACTIVATION_FUN config key. I installed the latest version using pip and tried executing the following piece of code

from pycls.models import effnet
effnet('B0')

If I edit the cache file under /tmp/pycls-download-cache/dds_baselines/effnet/EN-B0_dds_8gpu.yaml and comment out that key then the loading works.

Full error log

----> 2 effnet('B1')

/path/to/env/lib/python3.7/site-packages/pycls/models/model_zoo.py in effnet(name, pretrained, cfg_list)
    170     """Constructs an EfficientNet model (note: loads global config as well)."""
    171     name = name if "EfficientNet-" in name else "EfficientNet-" + name
--> 172     return build_model(name, pretrained, cfg_list)

/path/to/env/lib/python3.7/site-packages/pycls/models/model_zoo.py in build_model(name, pretrained, cfg_list)
    132     reset_cfg()
    133     config_file = get_config_file(name)
--> 134     cfg.merge_from_file(config_file)
    135     cfg.merge_from_list(cfg_list)
    136     # Construct model

/path/to/env/lib/python3.7/site-packages/yacs/config.py in merge_from_file(self, cfg_filename)
    211         with open(cfg_filename, "r") as f:
    212             cfg = self.load_cfg(f)
--> 213         self.merge_from_other_cfg(cfg)
    214 
    215     def merge_from_other_cfg(self, cfg_other):

/path/to/env/lib/python3.7/site-packages/yacs/config.py in merge_from_other_cfg(self, cfg_other)
    215     def merge_from_other_cfg(self, cfg_other):
    216         """Merge `cfg_other` into this CfgNode."""
--> 217         _merge_a_into_b(cfg_other, self, self, [])
    218 
    219     def merge_from_list(self, cfg_list):

/path/to/env/lib/python3.7/site-packages/yacs/config.py in _merge_a_into_b(a, b, root, key_list)
    476             if isinstance(v, CfgNode):
    477                 try:
--> 478                     _merge_a_into_b(v, b[k], root, key_list + [k])
    479                 except BaseException:
    480                     raise

/path/to/env/lib/python3.7/site-packages/yacs/config.py in _merge_a_into_b(a, b, root, key_list)
    489                 root.raise_key_rename_error(full_key)
    490             else:
--> 491                 raise KeyError("Non-existent config key: {}".format(full_key))
    492 
    493 

KeyError: 'Non-existent config key: MODEL.ACTIVATION_FUN'
@mhubii
Copy link

mhubii commented Apr 28, 2021

Hey @JJGO, got the same error, probably the pip package is not up to date. However, you can directly install from Github instead via

pip install git+https://github.com/facebookresearch/pycls@master

solved the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants