yolov7 icon indicating copy to clipboard operation
yolov7 copied to clipboard

ONNX export failure for mask

Open vincedupuis opened this issue 2 years ago • 2 comments

I tried the following: python export.py --weights yolov7-mask.pt --grid --end2end --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640

But I get this error: Starting export end2end onnx model for TensorRT... ONNX export failure: unhashable type: 'slice'

vincedupuis avatar Sep 15 '22 03:09 vincedupuis

hi @vincedupuis there is YOLOv7 inference with tensorRT、OpenVINO、ONNXRuntime,if you need https://github.com/PaddlePaddle/FastDeploy/blob/develop/examples/vision/detection/yolov7/README_EN.md

leiqing1 avatar Sep 19 '22 07:09 leiqing1

Hey , for me it says :"AttributeError: Can't get attribute 'Merge' on <module 'models.common' from '/home/cp/Development/yolov7/models/common.py'> "

danweil24 avatar Sep 19 '22 12:09 danweil24

Hey , for me it says :"AttributeError: Can't get attribute 'Merge' on <module 'models.common' from '/home/cp/Development/yolov7/models/common.py'> "

Hi @danweil24 , you just need to go to the mask branch. I used to also encounter the same issue, and the solution is to switch to the branch, hope it helps~

briliantnugraha avatar Nov 08 '22 08:11 briliantnugraha

@vincedupuis The following command works for me:

python export.py --weights yolov7-mask.pt --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640

The error ONNX export failure: unhashable type: 'slice' is not very helpful. However, by tracing code where the error raised, I did find out that the output of instance segmentation is a dictionary, so we can't use --grid and --end2end option during export, which seem to be designed for object detection yolo.

martin0258 avatar Nov 18 '22 18:11 martin0258

@vincedupuis The following command works for me:

python export.py --weights yolov7-mask.pt --simplify --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640

The error ONNX export failure: unhashable type: 'slice' is not very helpful. However, by tracing code where the error raised, I did find out that the output of instance segmentation is a dictionary, so we can't use --grid and --end2end option during export, which seem to be designed for object detection yolo.

This works for me. Thanks :)

Kataglyphis avatar Dec 01 '22 08:12 Kataglyphis