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

Unable to export to onnx #10

Open
tms2003 opened this issue Dec 18, 2024 · 1 comment
Open

Unable to export to onnx #10

tms2003 opened this issue Dec 18, 2024 · 1 comment

Comments

@tms2003
Copy link

tms2003 commented Dec 18, 2024

I used the export onnx function, but it said that the Src module could not be found. I copied the dfine module into it, but it still gave an error.

python tools/deployment/export_onnx.py --check -c /home/incar/tms/source/DEIM/configs/deim_dfine/deim_hgnetv2_x_coco.yml -r /home/incar/tms/source/DEIM/outputs/deim_hgnetv2_x_coco/best_stg2.pth
/home/incar/miniconda3/envs/rtdetr/lib/python3.10/site-packages/transformers/utils/generic.py:482: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
/home/incar/miniconda3/envs/rtdetr/lib/python3.10/site-packages/transformers/utils/generic.py:339: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
/home/incar/miniconda3/envs/rtdetr/lib/python3.10/site-packages/transformers/utils/generic.py:339: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
Traceback (most recent call last):
  File "/home/incar/tms/source/D-FINE/tools/deployment/export_onnx.py", line 103, in <module>
    main(args)
  File "/home/incar/tms/source/D-FINE/tools/deployment/export_onnx.py", line 35, in main
    cfg.model.load_state_dict(state)
  File "/home/incar/tms/source/D-FINE/tools/deployment/../../src/core/yaml_config.py", line 38, in model
    self._model = create(self.yaml_cfg['model'], self.global_cfg)
  File "/home/incar/tms/source/D-FINE/tools/deployment/../../src/core/workspace.py", line 121, in create
    module = getattr(cfg['_pymodule'], name)
KeyError: '_pymodule'

@ShihuaHuang95
Copy link
Owner

Thank you very much for your interest and attention to our work. If you like what we’ve done, please consider giving this repo a star.
Have you solved this problem by checking the code or changing the path?

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