Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码bug #1

Open
violet2422 opened this issue Sep 1, 2021 · 6 comments
Open

代码bug #1

violet2422 opened this issue Sep 1, 2021 · 6 comments

Comments

@violet2422
Copy link

我用原作者的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,我将万分感激!!!

@hpc203
Copy link
Owner

hpc203 commented Sep 2, 2021

我可能大概知道了问题,原模型在网络末端没有cat,您的代码cat了

对,源代码里输出2个尺度特征图的,我在转换onnx文件的程序里做了一个torch.cat的处理,把两个输出特征图拼接成一个

@inapp123
Copy link

inapp123 commented Nov 5, 2021

对,源代码里输出2个尺度特征图的,我在转换onnx文件的程序里做了一个torch.cat的处理,把两个输出特征图拼接成一个

好兄弟,你能提供以一下修改的方案嘛

我这有修改方案 微信 violet-2422

您好~请问能劳烦传一份到git这边嘛qwq
这样大家看起来应该都方便一些qwq

@eitan-weintraub
Copy link

eitan-weintraub commented Nov 11, 2021

Can you please share the modification done to the original yolo-fastestv2 (torch.cat process)?

@danielzhangau
Copy link

我在原代码model/detector.py的forward function里修改,因为我看这里有两个tensor output,但他们size不一样
image

image
我也不是很确定是不是修改这里,求指导~ Any helps will be appreciated!!

@danielzhangau
Copy link

danielzhangau commented Nov 26, 2021

issue fixed! Can check out my new pull request in the original work. Hope it helps!
#5 (comment)

@LHyang9527
Copy link

对,源代码里输出2个尺度特征图的,我在转换onnx文件的程序里做了一个torch.cat的处理,把两个输出特征图拼接成一个

好兄弟,你能提供以一下修改的方案嘛

我这有修改方案 微信 violet-2422

您好~请问能劳烦传一份到git这边嘛qwq 这样大家看起来应该都方便一些qwq

是的呀,直接在这个issue里完善答案不就行了,留微信是什么意思?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants