onnx / onnx/optimizer

Pass "eliminate_consecutive_idempotent_ops" succeeds but model gives an incompatible shape error upon run.

Open
#171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
834
Forks
109
Avg merge
6h 55m
Merged PRs (30d)
2

Description

While optimizing a number of Mask and Faster R-CNN models on opset=12 from the ONNX Model Hub, the optimizer generated the models, but I encountered the following error when applying the eliminate_consecutive_idempotent_ops error when I run them:

[ONNXRuntimeError] : 1 : FAIL : Node (<NODE>) Op (Reshape) [ShapeInferenceError] Dimension could not be inferred: incompatible shapes

Where is:
2953 for the Mask models: Mask R-CNN R-50-FPN-int8, Mask R-CNN R-50-FPN-qdq, Mask R-CNN R-50-FPN-fp32.
2794 for the Faster models: Faster R-CNN R-50-FPN-int8, Faster R-CNN R-50-FPN-qdq, and Faster R-CNN R-50-FPN-fp32.

The original models run without problems. By visual inspection using Netron, I believe something is mishandled with the concatenation operations preceding these nodes in the models.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by applying eliminate_consecutive_idempotent_ops to the listed Mask R-CNN and Faster R-CNN R-50-FPN models at opset 12, then run them with ONNX Runtime. Inspect nodes 2953 and 2794 and the preceding concatenation operations, using Netron as suggested. Done means the optimized models run without the incompatible-shapes Reshape error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.