ThanatosShinji / onnx-tool

A parser, editor and profiler tool for ONNX models.
https://pypi.org/project/onnx-tool/
MIT License
379 stars 50 forks source link

this Node Loop-generic_loop_Loop__42 has no value_infer on SSD-mobilenet-int8 #87

Open saurabhtangri opened 1 month ago

saurabhtangri commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to : https://github.com/onnx/models/blob/main/validated/vision/object_detection_segmentation/ssd-mobilenetv1/model/ssd_mobilenet_v1_12-int8.onnx

SSD-MobilenetV1-12-qdq

import onnx_tool import numpy as np modelpath = '/home/ssd_mobilenet_v1_13-qdq.onnx' m = onnx_tool.Model(modelpath) m.graph.shape_infer({'inputs': np.ones((1,383,640,3), dtype=np.uint8)}) # update tensor shapes with new input tensor m.graph.profile() m.graph.print_node_map() # console print

m.save_model('/home/ssd_mobilenet_v1_13-qdq-mods.onnx', shape_only=False) # only with weight tensor shapes and dynamic tensor shapes

  1. See error NotImplementedError(f'this Node {self.op_type}-{self.name} has no value_infer this Node Loop-generic_loop_Loop__42 has no value_infer

Screenshots If applicable, add screenshots to help explain your problem.

ThanatosShinji commented 1 month ago

it's a known issue that Loop is not supported. But this model is not simplified. image The real model body does not have this Loop node. It should start with this Mul node.