SSD icon indicating copy to clipboard operation
SSD copied to clipboard

The problem of conversion from pth format model to onnx model

Open NOBUGW opened this issue 5 years ago • 3 comments

Hello, I hope there is a problem in the process of converting your pre training model to onnx. Can you help me solve it? I used: torch.onnx.export For weights / vgg_ ssd300_ Voc0712.pth,But,The program Display"RuntimeError: Only tuples, lists and Variables supported as JIT inputs/outputs. Dictionaries and strings are also accepted but their usage is not recommended. But got unsupported type Container"

NOBUGW avatar Oct 12 '20 06:10 NOBUGW

hi,man,have you solved this question? I have the same question.

zcf2020DPL avatar Dec 09 '20 11:12 zcf2020DPL

I have solved the question,and it is not a question, postprocessor has unsupported type Container... no need postprocessor in convert to onnx, so #detections = self.post_processor(detections) in box_head.py

zcf2020DPL avatar Dec 10 '20 12:12 zcf2020DPL

@zcf2020DPL , the onnx conversion can be done including the self.post_processor(detections) call in the box_head.py if the container class is not used in the Postprocessor object in ssd/modeling/box_head/inference.py.

I have created a onnx conversion script for the networks, it works for the mobilenets properly right now. @lufficc , if you check out my pull request now

SamSamhuns avatar Apr 29 '21 12:04 SamSamhuns