open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.74k stars 628 forks source link

使用python mmdeploy/tools/deploy.py 部署时报错 #1163

Closed Chriost closed 1 year ago

Chriost commented 2 years ago

命令:python mmdeploy/tools/deploy.py mmdeploy/configs/mmdet/detection/detection_tensorrt_dynamic-320x320-1344x1344.py mmdetection/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py mmdeploy/checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth mmdetection/demo/demo.jpg --work-dir mmdeploy_model/faster-rcnn --device cuda --dump-info

报错: ImportError: cannot import name 'DistancePointBBoxCoder' from 'mmdet.core.bbox.coder'

mm-assistant[bot] commented 2 years ago

We recommend using English or English & Chinese for issues so that we could have broader discussion.

hanrui1sensetime commented 1 year ago

Could you please execute python tools/check_env.py for more information? Seems like your env has wrong version match.

github-actions[bot] commented 1 year ago

This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.

github-actions[bot] commented 1 year ago

This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.

siriasadeddin commented 1 year ago

I am having the same issue when trying to export a gfl model.

python ./tools/deploy.py ./configs/mmdet/detection/detection_onnxruntime_dynamic.py ../ICDAR2021_MFD/configs/gfl/gfl_s50_fpn_2x_coco.py ../ICDAR2021_MFD/checkpoints/mfd_gfl_s50.pth ../ICDAR2021_MFD/demo/demo.jpg --work-dir work_dir --show --device cuda:0
-----------------------------------------------------------------------------------------------------------------------
 File "mmdeploy\mmdeploy\codebase\mmdet\models\dense_heads\base_dense_head.py", line 3, in <module>
    from mmdet.core.bbox.coder import (DeltaXYWHBBoxCoder, DistancePointBBoxCoder,      
ImportError: cannot import name 'DistancePointBBoxCoder' from 'mmdet.core.bbox.coder' (mmdet\core\bbox\coder\__init__.py)       
2022-12-31 00:50:03,735 - mmdeploy - ERROR - `mmdeploy.apis.pytorch2onnx.torch2onnx` with Call id: 0 failed. exit.

I also tried Chriost code and get the same error message