facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
29.79k stars 7.38k forks source link

Error when running inference using demo.py - <class 'functools.partial'> is not a valid type #5130

Open Abdulmalik0x opened 10 months ago

Abdulmalik0x commented 10 months ago

Hey!

As described in the title, I'm facing an issue related to yacs library as it doesn't recognize the type function.partial inside my config file which is generated by detectron2 platform.

Traceback (most recent call last):
  File "/raid/malik/github/EVA/EVA-01/det/./demo/demo.py", line 100, in <module>
    cfg = setup_cfg(args)
  File "/raid/malik/github/EVA/EVA-01/det/./demo/demo.py", line 29, in setup_cfg
    cfg.merge_from_file(args.config_file)
  File "/raid/malik/github/EVA/EVA-01/det/detectron2/config/config.py", line 47, in merge_from_file
    loaded_cfg = type(self)(loaded_cfg)
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 86, in __init__
    init_dict = self._create_config_tree_from_dict(init_dict, key_list)
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 126, in _create_config_tree_from_dict
    dic[k] = cls(v, key_list=key_list + [k])
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 86, in __init__
    init_dict = self._create_config_tree_from_dict(init_dict, key_list)
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 126, in _create_config_tree_from_dict
    dic[k] = cls(v, key_list=key_list + [k])
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 86, in __init__
    init_dict = self._create_config_tree_from_dict(init_dict, key_list)
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 126, in _create_config_tree_from_dict
    dic[k] = cls(v, key_list=key_list + [k])
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 86, in __init__
    init_dict = self._create_config_tree_from_dict(init_dict, key_list)
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 129, in _create_config_tree_from_dict
    _assert_with_logging(
  File "/home/research/anaconda3/envs/eva/lib/python3.9/site-packages/yacs/config.py", line 545, in _assert_with_logging
    assert cond, msg
AssertionError: Key model.backbone.net.norm_layer with value <class 'functools.partial'> is not a valid type; valid types: {<class 'NoneType'>, <class 'int'>, <class 'float'>, <class 'str'>, <class 'list'>, <class 'tuple'>, <class 'bool'>}

Thanks, Abdulmalik

github-actions[bot] commented 10 months ago

We found that not enough information is provided about this issue. Please provide details following the issue template.

Abdulmalik0x commented 9 months ago

Can you support regarding this please!

eliasm56 commented 2 months ago

Any progress on this issue?