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

fix bug onnx export with nms. Onnx operator WHERE requires inputs of same type #988

Open
3 tasks done
edelah opened this issue Apr 13, 2024 · 0 comments · May be fixed by #989
Open
3 tasks done

fix bug onnx export with nms. Onnx operator WHERE requires inputs of same type #988

edelah opened this issue Apr 13, 2024 · 0 comments · May be fixed by #989

Comments

@edelah
Copy link

edelah commented Apr 13, 2024

Prerequisite

🐞 Describe the bug

There is a type mismatch in the inputs of /Where_1 node in onnx model graph model. The model can not be loaded.

Traceback (most recent call last):
File "/home/unknown/code/chessvideos/tests/test_onnx_raw.py", line 14, in
session = onnxruntime.InferenceSession(
File "/home/unknown/miniconda3/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 347, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/home/unknown/miniconda3/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 384, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from /home/unknown/code/chessvideos/models/global/rtmdet_tiny_nms.onnx failed:Type Error: Type parameter (T) of Optype (Where) bound to different types (tensor(int64) and tensor(float) in node (/Where_1).

Environment

torch 2.1.0
cuda 12.1
mmengine>=0.6.0
mmcv 2.1.0
mmdet 3.3.0

Additional information

  • code used to export the model to onnx:

!python /content/mmyolo/projects/easydeploy/tools/export_onnx.py
/content/mmyolo/work_dirs/custom/20240413_200608/vis_data/config.py
/content/epoch_10.pth
--work-dir work_dirs/rtmdet
--img-size 640 640
--batch 1
--device cpu
--simplify
--pre-topk 1000
--keep-topk 100
--iou-threshold 0.80
--score-threshold 0.20

@edelah edelah changed the title bug in rtmdet conversion to onnx to be deleted Apr 14, 2024
@edelah edelah changed the title to be deleted fix bug onnx export with nms. Onnx operator WHERE requires inputs of same type Apr 14, 2024
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

Successfully merging a pull request may close this issue.

1 participant