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

How to convert densepose model to onnx? #5286

Open
Asadashino-o opened this issue May 15, 2024 · 1 comment
Open

How to convert densepose model to onnx? #5286

Asadashino-o opened this issue May 15, 2024 · 1 comment
Labels
documentation Problems about existing documentation or comments

Comments

@Asadashino-o
Copy link

I run export_model.py as below:

python detectron2/tools/deploy/export_model.py --config-file detectron2/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml --output densepose.onnx --format onnx --sample-image example.jpg --export-method tracing MODEL.DEVICE cuda MODEL.WEIGHTS model_final_162be9.pkl

Maybe there is some errors:
Traceback (most recent call last):
File "/data/hdd1/xietingyu/vid2densepose/detectron2/tools/deploy/export_model.py", line 261, in
main() # pragma: no cover
File "/data/hdd1/xietingyu/vid2densepose/detectron2/tools/deploy/export_model.py", line 225, in main
cfg = setup_cfg(args)
File "/data/hdd1/xietingyu/vid2densepose/detectron2/tools/deploy/export_model.py", line 34, in setup_cfg
cfg.merge_from_file(args.config_file)
File "/data/hdd1/xietingyu/miniconda3/envs/det/lib/python3.9/site-packages/detectron2/config/config.py", line 69, in merge_from_file
self.merge_from_other_cfg(loaded_cfg)
File "/data/hdd1/xietingyu/miniconda3/envs/det/lib/python3.9/site-packages/fvcore/common/config.py", line 132, in merge_from_other_cfg
return super().merge_from_other_cfg(cfg_other)
File "/data/hdd1/xietingyu/miniconda3/envs/det/lib/python3.9/site-packages/yacs/config.py", line 217, in merge_from_other_cfg
_merge_a_into_b(cfg_other, self, self, [])
File "/data/hdd1/xietingyu/miniconda3/envs/det/lib/python3.9/site-packages/yacs/config.py", line 478, in _merge_a_into_b
_merge_a_into_b(v, b[k], root, key_list + [k])
File "/data/hdd1/xietingyu/miniconda3/envs/det/lib/python3.9/site-packages/yacs/config.py", line 491, in _merge_a_into_b
raise KeyError("Non-existent config key: {}".format(full_key))
KeyError: 'Non-existent config key: MODEL.DENSEPOSE_ON'

It seems detectron2 give no way to convert densepose?
What should I do? Thank you!

@Asadashino-o Asadashino-o added the documentation Problems about existing documentation or comments label May 15, 2024
@Programmer-RD-AI
Copy link
Contributor

Hi,
Please refer to issues #258 and #5111 which show case the same issue...
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Problems about existing documentation or comments
Projects
None yet
Development

No branches or pull requests

2 participants