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

onnx转换失败 #5

Closed
1124676457 opened this issue Mar 1, 2022 · 2 comments
Closed

onnx转换失败 #5

1124676457 opened this issue Mar 1, 2022 · 2 comments

Comments

@1124676457
Copy link

我发现使用onnx转换后,输出是11个,不是代码里面的三个,而且我用shape 768 1344去转换,直接报错
Traceback (most recent call last):
File "onnx_exporter.py", line 231, in
check(args, dummy_input, check_onnx=True, check_trt=False)
File "onnx_exporter.py", line 126, in check
sess = rt.InferenceSession(args.out)
File "/home/tao/anaconda3/lib/python3.8/site-packages/onnxruntime/capi/session.py", line 195, in init
self._create_inference_session(providers, provider_options)
File "/home/tao/anaconda3/lib/python3.8/site-packages/onnxruntime/capi/session.py", line 205, in _create_inference_session
sess.initialize_session(providers or [], provider_options or [])
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Node (Concat_637) Op (Concat) [ShapeInferenceError] Can't merge shape info. Both source and target dimension have values but they differ. Source=49 Target=48 Dimension=2

这个是我在single_stage_ins 加了你介绍的代码后出现的,不加就不会报错,但输出就变成10个了,求教

@1124676457
Copy link
Author

@chenjianqu

@chenjianqu
Copy link
Owner

输出11个张量是对的, 因为Solov2采用了FPN架构.所有输出的张量维度为: {1, 128, 12, 12},
{1, 128, 16, 16},
{1, 128, 24, 24},
{1, 128, 36, 36},
{1, 128, 40, 40},
{1, 80, 12, 12},
{1, 80, 16, 16},
{1, 80, 24, 24},
{1, 80, 36, 36},
{1, 80, 40, 40},
{1, 128, 96, 288},
我的代码里也是这样定义的

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