microsoft / onnxruntime-extensions

onnxruntime-extensions: A specialized pre- and post- processing library for ONNX Runtime
MIT License
340 stars 91 forks source link

Customized yolov8-pose model, and the number of key points mask data is not equal to 56 #833

Open ccl-private opened 4 weeks ago

ccl-private commented 4 weeks ago

I have trained a custom key-points model, which causes 'mask' data to be not 56. so I modified two places. First assert classes_masks_out == custom_num; Second, post_processing_steps Split(num_outputs=3, axis=1, splits=[4, 1, custom_num]). But when running it, it reported an error. Here is the output log: Updating model with jpg/png image bytes as input. Adding pre/post processing to the model... Updating model ... Pre/post proceessing added. Updated model saved. Running the model to validate output using /slow_disk/ccl/data/goji_pose/data/2024-10-14 095626.jpg. Traceback (most recent call last): File "/slow_disk/ccl/codes/yolo_custom/onnx_core_goji.py", line 373, in _run_inference(updated_model_path, args.input, args.output_image is not None, args.test_image, rgb_layout) File "/slow_disk/ccl/codes/yolo_custom/onnx_core_goji.py", line 240, in _run_inference session = ort.InferenceSession(str(onnx_model_path), providers=providers, sess_options=session_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/slow_disk/ccl/codes/yolo_custom/.venv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/slow_disk/ccl/codes/yolo_custom/.venv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 491, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Node (post_process_57) Op (Reshape) [ShapeInferenceError] Invalid position of 0.