TNTWEN / Pruned-OpenVINO-YOLO

Deploy the pruned YOLOv3/v4/v4-tiny/v4-tiny-3l model on OpenVINO embedded devices
Apache License 2.0
52 stars 11 forks source link

Convert pruned model to onnx #9

Open tungth07 opened 2 years ago

tungth07 commented 2 years ago

Hi,

I have used your project to pruned yolov4-tiny model succeed. And i want to convert my pruned model (in pt format) to onnx to deploy on my system. But when I set ONNX_EXPORT to True, I get the following error: File "workspaces/Pruned-OpenVINO-YOLO/Pruneyolov3v4/models.py", line 207, in forward p = p.view(bs, self.na, self.no, self.ny, self.nx).permute(0, 1, 3, 4, 2).contiguous() # prediction RuntimeError: shape '[1, 3, 11, 64, 64]' is invalid for input of size 8448

I think this error is because the pruned model has changed the filter parameters in some layers compared to the original model.

I attached the configuration file of my model before and after pruning. Please help to to resolved this problem. Thanks

yolov4-tiny.txt prune_0.71_keep_0.01_yolov4-tiny.txt