yolo-fastestv2-opencv
yolo-fastestv2-opencv copied to clipboard
代码bug
我用原作者的pytorch2onnx导出onnx文件后,进行加载识别时出现以下错误
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)
当我调试时,发现detect函数中的len(outs)为1,我觉得这是不合理的,您是否可以上传以下pytorch转onnx的代码,或者看一下如何修改bug,我将万分感激!!!
我可能大概知道了问题,原模型在网络末端没有cat,您的代码cat了
对,源代码里输出2个尺度特征图的,我在转换onnx文件的程序里做了一个torch.cat的处理,把两个输出特征图拼接成一个
对,源代码里输出2个尺度特征图的,我在转换onnx文件的程序里做了一个torch.cat的处理,把两个输出特征图拼接成一个
好兄弟,你能提供以一下修改的方案嘛
我这有修改方案 微信 violet-2422
您好~请问能劳烦传一份到git这边嘛qwq 这样大家看起来应该都方便一些qwq
Can you please share the modification done to the original yolo-fastestv2 (torch.cat process)?
我在原代码model/detector.py的forward function里修改,因为我看这里有两个tensor output,但他们size不一样
我也不是很确定是不是修改这里,求指导~ Any helps will be appreciated!!
issue fixed! Can check out my new pull request in the original work. Hope it helps! https://github.com/hpc203/yolo-fastestv2-opencv/issues/5#issuecomment-979707357
对,源代码里输出2个尺度特征图的,我在转换onnx文件的程序里做了一个torch.cat的处理,把两个输出特征图拼接成一个
好兄弟,你能提供以一下修改的方案嘛
我这有修改方案 微信 violet-2422
您好~请问能劳烦传一份到git这边嘛qwq 这样大家看起来应该都方便一些qwq
是的呀,直接在这个issue里完善答案不就行了,留微信是什么意思?