WisconsinAIVision / yolact_edge

The first competitive instance segmentation approach that runs on small edge devices at real-time speeds.
MIT License
1.27k stars 273 forks source link

convert from yolact_edge to onnx #182

Open yujin6056 opened 2 years ago

yujin6056 commented 2 years ago

I made the codes to convert from yolact_edge to onnx with reference to https://github.com/hpc203/yolact-opencv-dnn-cpp-python. Here is https://github.com/yujin6056/yolactedge-onnx-conversion.

Let me know if you have any questions.

damianozappia commented 2 years ago

Hi, I just ran your code try to convert the 'yolact_edge_54_800000.pth' file from official yolact_edge repo but I receive the following error: RuntimeError: Tried to trace <__torch__.yolact_edge.yolact.FPN_phase_1 object at 0x60b95f0> but it is not part of the active trace. Modules that are called during a trace must be registered as submodules of the thing being traced. Do you have any suggestion to solve? Thanks in advance

anthonygofin commented 1 year ago

Hi @damianozappia. In yolact.py, try to remove lines @script_method_wrapper in classes FPN, FPN_phase_1 and FPN_phase_2. It worked for me, though I cannot explain why and I do not know if it has an impact on the resulting ONNX file.