microsoft / microsoft/onnxruntime

yolov3-tiny model float16 quantization (InvalidArgument: [ONNXRuntimeError] )

Open
#12,152 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Hi everyone,

I quantized yolov3-tiny model with float16 and run the model in onnxruntime

ort_session = ort.SessionOptions()
ort_session.graph_optimization_level = ort.GraphOptimizationLevel.ORT_DISABLE_ALL
sess = ort.InferenceSession(model_path, ort_session, providers=['CPUExecutionProvider'])
image = np.ones(shape=(1, 3, 416, 416), dtype=np.float16)
image_size = np.random.rand(1, 2).astype('float16')
input_name1 = sess.get_inputs()[0].name
input_name2 = sess.get_inputs()[1].name
output = sess.run(None, {input_name1: image, input_name2: image_size})

But I have this issue :
InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from ./tiny_yolov3_fp16.onnx failed:This is an invalid model. Type Error: Type 'tensor(float16)' of input parameter (yolo_evaluation_layer_1/concat_6:0_btc) of operator (NonMaxSuppression) in node (yolonms_layer_1/non_max_suppression/NonMaxSuppressionV3) is invalid.

Is there way I can fix this non_max_suppresion problem?
I would really appreciate it if you give me any idea. Thank you for your time.

model file :
tiny_yolov3_fp16.zip

Contributor guide

Open the contributing guide

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

Start with the attached tiny_yolov3_fp16.zip model and the Python reproduction using CPUExecutionProvider. Inspect the NonMaxSuppressionV3 node and its tensor(float16) input, then verify the model against ONNX Runtime's supported input types. Done means the model loads and the provided sess.run call completes without the invalid-graph error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.