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

run convert_onnx.py , I get the warning TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! route = F.interpolate(xRt3, size=(int(xRt3.shape[2] * 2), int(xRt3.shape[3] * 2)), mode='nearest') #3

Open
xuwei1119 opened this issue Jan 22, 2021 · 1 comment

Comments

@xuwei1119
Copy link

xuwei1119 commented Jan 22, 2021

Then when I infer the *.onnx by above, I get :
cannot reshape array of size 1632000 into shape (1,3,6,80,80)
cannot reshape array of size 408000 into shape (1,3,6,40,40)
cannot reshape array of size 102000 into shape (1,3,6,20,20)
Use YOLOV5 v3.1 yolov5s.pt file.

@hpc203
Copy link
Owner

hpc203 commented Jan 22, 2021

Then when I infer the *.onnx by above, I get :
cannot reshape array of size 1632000 into shape (1,3,6,80,80)
cannot reshape array of size 408000 into shape (1,3,6,40,40)
cannot reshape array of size 102000 into shape (1,3,6,20,20)
Use YOLOV5 v3.1 yolov5s.pt file.

你的网络的类别数量是6,在convert_onnx.py中默认是coco数据集的80类,因此你需要修改num_classes=6

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

2 participants