mmdetection: AttributeError: 'CascadeRoIHead' object has no attribute 'onnx_export'
Thanks for your error report and we appreciate it a lot.
Checklist
- I have searched related issues but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version.
Describe the bug A clear and concise description of what the bug is. cascade_rcnn 使用python3.7.5 tools/deployment/pytorch2onnx.py configs/cascade_rcnn/cascade_rcnn_r50_fpn_1x_coco.py ./cascade_rcnn_r50_fpn_1x_coco_20200316-3dc56deb.pth --shape=1216 --output-file=cascadedRCNN.onnx 导出onnx报错,错误:AttributeError: ‘CascadeRoIHead’ object has no attribute ‘onnx_export’ Reproduction
- What command or script did you run?
A placeholder for the command.
- Did you make any modifications on the code or config? Did you understand what you have modified?
- What dataset did you use?
Environment ubuntu18.04 x86
- Please run
python mmdet/utils/collect_env.pyto collect necessary environment information and paste it here. - You may add addition that may be helpful for locating the problem, such as
- How you installed PyTorch [e.g., pip, conda, source]
- Other environment variables that may be related (such as
$PATH,$LD_LIBRARY_PATH,$PYTHONPATH, etc.)
Error traceback If applicable, paste the error trackback here.
A placeholder for trackback.
Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (2 by maintainers)
@pengaoao I did it in PR #5486, the Cascade-RCNN can be exported to ONNX with batch dimension. The visualization result seems reasonable, You can try it. PR #5486 would be merged soon
you need to pay attention to the code segment before the
add_dummy_nms_for_onnxthat I changed inbbox_head.py.add_dummy_nms_for_onnxhas two sets of parameter forms, it is easy to make mistakes.