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

'aten::broadcast_to' to ONNX opset version 14 is not supported. #1

Closed
Hongyuan-Liu opened this issue Mar 27, 2024 · 1 comment
Closed

Comments

@Hongyuan-Liu
Copy link

在scripts目录下,执行mkdir weights,python hf_demo.py,报如下错误:
Exporting the operator 'aten::broadcast_to' to ONNX opset version 14 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: https://github.com/pytorch/pytorch/issues.
None

Traceback (most recent call last):
File "/dataset/liuhongyuan/workspace/scenic/OWLVIT-ONNX-AX650-CPP/scripts/hf_demo.py", line 16, in
torch.onnx.export(model, (inputs["input_ids"],inputs["pixel_values"],inputs["attention_mask"]), "weights/owlvit.onnx", opset_version=14,
File "/home/liuhongyuan/workspace/miniconda3/envs/owl/lib/python3.10/site-packages/torch/onnx/utils.py", line 506, in export
_export(
File "/home/liuhongyuan/workspace/miniconda3/envs/owl/lib/python3.10/site-packages/torch/onnx/utils.py", line 1548, in _export
graph, params_dict, torch_out = _model_to_graph(
File "/home/liuhongyuan/workspace/miniconda3/envs/owl/lib/python3.10/site-packages/torch/onnx/utils.py", line 1117, in _model_to_graph
graph = _optimize_graph(
File "/home/liuhongyuan/workspace/miniconda3/envs/owl/lib/python3.10/site-packages/torch/onnx/utils.py", line 665, in _optimize_graph
graph = _C._jit_pass_onnx(graph, operator_export_type)
File "/home/liuhongyuan/workspace/miniconda3/envs/owl/lib/python3.10/site-packages/torch/onnx/utils.py", line 1901, in _run_symbolic_function
raise errors.UnsupportedOperatorError(
torch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::broadcast_to' to ONNX opset version 14 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: https://github.com/pytorch/pytorch/issues.
尝试过,opset_version=15,16,17,18,依然是不支持

@ZHEQIUSHUI
Copy link
Member

更新torch,用最新版

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