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

Attempting to broadcast an axis by a dimension other than 1. 16 by 96 #7

Closed
veepersgit opened this issue May 23, 2019 · 6 comments
Closed
Labels
external issue Issues caused by external library, like onnxruntime, pytorch->onnx converter

Comments

@veepersgit
Copy link

Here's the error message:
Simplifying...
Traceback (most recent call last):
File "/home/mywp/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/mywp/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/mywp/anaconda3/lib/python3.6/site-packages/onnxsim/main.py", line 24, in
main()
File "/home/mywp/anaconda3/lib/python3.6/site-packages/onnxsim/main.py", line 17, in main
model_opt = onnxsim.simplify(args.input_model, check_n=args.check_n, perform_optimization=not args.skip_optimization)
File "/home/mywp/anaconda3/lib/python3.6/site-packages/onnxsim/onnx_simplifier.py", line 187, in simplify
model_opt = eliminate_const_nodes(model_opt, get_constant_nodes(model_opt), forward_all(model_opt))
File "/home/mywp/anaconda3/lib/python3.6/site-packages/onnxsim/onnx_simplifier.py", line 105, in forward_all
res = forward(model)
File "/home/mywp/anaconda3/lib/python3.6/site-packages/onnxsim/onnx_simplifier.py", line 97, in forward
res = OrderedDict(zip(outputs, sess.run(outputs, inputs)))
File "/home/mywp/anaconda3/lib/python3.6/site-packages/onnxruntime/capi/session.py", line 72, in run
return self._sess.run(output_names, input_feed, run_options)
RuntimeError: Method run failed due to: [ONNXRuntimeError] : 1 : GENERAL ERROR : /onnxruntime_src/onnxruntime/core/providers/cpu/math/element_wise_ops.h:341 void onnxruntime::BroadcastIterator::Init(int64_t, int64_t) axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. 16 by 96
Stacktrace:

@daquexian
Copy link
Owner

Thanks for your report! Could you please provide your ONNX model? You can send me by email: daquexian566@gmail.com

@daquexian
Copy link
Owner

It is a bug of pytorch->onnx converter. I have reported it to PyTorch: pytorch/pytorch#21271

@daquexian daquexian added the external issue Issues caused by external library, like onnxruntime, pytorch->onnx converter label Jun 3, 2019
@daquexian
Copy link
Owner

daquexian commented Jun 12, 2019

It is solved in pytorch/pytorch#21330. Please install nightly PyTorch and re-export the onnx model then try again.

@weihua04
Copy link

It is solved in pytorch/pytorch#21330. Please install nightly PyTorch and re-export the onnx model then try again.

thank u for reply, i have met the same problem ,could u tell me how to install nightly PyTorch? thank u very much

@daquexian
Copy link
Owner

daquexian commented Jul 13, 2019

It is solved in pytorch/pytorch#21330. Please install nightly PyTorch and re-export the onnx model then try again.

thank u for reply, i have met the same problem ,could u tell me how to install nightly PyTorch? thank u very much

On https://pytorch.org/get-started/locally/, select "preview(nightly)" to get the command

@daquexian
Copy link
Owner

I believe pytorch/pytorch#21330 has been included in PyTorch 1.2, so it's better to install pytorch 1.2 than pytorch nightly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external issue Issues caused by external library, like onnxruntime, pytorch->onnx converter
Projects
None yet
Development

No branches or pull requests

3 participants