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

Detectron2 external projects #7

Open
Auth0rM0rgan opened this issue Mar 11, 2020 · 4 comments
Open

Detectron2 external projects #7

Auth0rM0rgan opened this issue Mar 11, 2020 · 4 comments

Comments

@Auth0rM0rgan
Copy link

Auth0rM0rgan commented Mar 11, 2020

Hey @jagin,

I would like to ask you how can I connect Detectron2 external projects(like this one: https://github.com/youngwanLEE/centermask2) to the pipeline?

Thanks!

@jagin
Copy link
Owner

jagin commented Mar 12, 2020

@Auth0rM0rgan I was able to quickly look at that project and for me it looks like you should be able to use CenterMask models without any problem. Try to use --config-file option to load the model you need.

@Auth0rM0rgan
Copy link
Author

Auth0rM0rgan commented Mar 12, 2020

Hey @jagin,

I have tried to run the process_video.py with the absolute path to the centermask config file but I am getting an error that Non-existent config key: MODEL.VOVNET

This is my command:
python process_video.py -i 0 -p -d --config-file /home/XXX/centermask2/configs/centermask/centermask_V_39_eSE_FPN_ms_3x.yaml

This is the error I am getting:

Traceback (most recent call last): File "process_video.py", line 155, in <module> main(args) File "process_video.py", line 91, in main cpu=False if args.gpus > 0 else True) File "/home/media4us/PycharmProjects/detectron2-pipeline/pipeline/utils/detectron.py", line 9, in setup_cfg cfg.merge_from_file(config_file) File "/home/media4us/PycharmProjects/detectron2/detectron2/config/config.py", line 47, in merge_from_file self.merge_from_other_cfg(loaded_cfg) File "/home/media4us/anaconda3/lib/python3.7/site-packages/fvcore/common/config.py", line 121, in merge_from_other_cfg return super().merge_from_other_cfg(cfg_other) File "/home/media4us/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 217, in merge_from_other_cfg _merge_a_into_b(cfg_other, self, self, []) File "/home/media4us/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 460, in _merge_a_into_b _merge_a_into_b(v, b[k], root, key_list + [k]) File "/home/media4us/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 473, in _merge_a_into_b raise KeyError("Non-existent config key: {}".format(full_key)) KeyError: 'Non-existent config key: MODEL.VOVNET'

Thanks!

@jagin
Copy link
Owner

jagin commented Mar 12, 2020

I'm not able to help you with that. First I would check if your model is working with the demo sources of centermask2 project. Maybe there is something missing in my pipeline considering centermask2.
Good luck!

@ShahriyarR
Copy link

ShahriyarR commented Mar 13, 2020

Well, I was able to get rid off the KeyError: 'Non-existent config key: MODEL.VOVNET' by:

  • cloning vovnet-detectron2 into detectron2-pipeline project.
  • rename vovnet-detectron2 to vovnet_detectron2
  • Then edit detectron2-pipeline/pipeline/utils/detectron.py
  • Add and import statement above
    from vovnet_detectron2.vovnet import add_vovnet_config
  • Then call add_vovnet_config() inside setup_cfg() as:
import torch
from detectron2.config import get_cfg
from vovnet_detectron2.vovnet import add_vovnet_config
def setup_cfg(config_file, weights_file=None, config_opts=[], confidence_threshold=None, cpu=False):
    # load config from file and command-line arguments
   cfg = get_cfg()
   add_vovnet_config(cfg)
   ...
   ...

But now the new error is:
KeyError: 'Non-existent config key: MODEL.FCOS

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

3 participants