Yolo-FastestV2 icon indicating copy to clipboard operation
Yolo-FastestV2 copied to clipboard

convert pytorch to onnx format

Open danielzhangau opened this issue 3 years ago • 2 comments

I am trying to rebuild and use my own trained model on this OpenCV version of yolofastestv2: https://github.com/hpc203/yolo-fastestv2-opencv But I got the following error message:

Traceback (most recent call last):
  File "E:\MyWork\Yolo-FastestV2\dnn.py", line 112, in <module>
    outputs = model.detect(srcimg)
  File "E:\MyWork\Yolo-FastestV2\dnn.py", line 91, in detect
    outputs[top:top + length, 0:2] = (outs[row_ind:row_ind + length,
ValueError: operands could not be broadcast together with shapes (1,2,22,95) (484,2) 

My understanding is the model output is two different scale of feature maps, but the OpenCV version implementation only accept one. So does anyone know how to concatenate two features maps when converting the format from PyTorch to onnx?

danielzhangau avatar Nov 24 '21 04:11 danielzhangau

issue fixed! Can check out my new pull request. Hope it helps! https://github.com/dog-qiuqiu/Yolo-FastestV2/pull/44#issue-1064116145

danielzhangau avatar Nov 26 '21 05:11 danielzhangau

目前依然存在相同的问题,请问如何解决呢

Jia-py avatar Jan 05 '22 14:01 Jia-py