yolov7
yolov7 copied to clipboard
ONNX export failure for mask
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'
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
Hey , for me it says :"AttributeError: Can't get attribute 'Merge' on <module 'models.common' from '/home/cp/Development/yolov7/models/common.py'> "
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~
@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.
@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 :)