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

UnsupportedOperatorError: Exporting the operator ::_transformer_encoder_layer_fwd to ONNX opset #59

Open
Peterzzz-hub opened this issue Mar 1, 2024 · 2 comments

Comments

@Peterzzz-hub
Copy link

Peterzzz-hub commented Mar 1, 2024

when i try to export onnx model from fairseq, i encountered this error. plz help support this operator

Traceback (most recent call last):
  File "/home/workspace/terminal_launching/pt2onnx.py", line 92, in <module>
    torch.onnx.export(model.encoder, sample_input['net_input'], onnx_file_path, input_names=input_names, output_names=output_names, verbose=True, opset_version=14)
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/__init__.py", line 350, in export
    return utils.export(
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/utils.py", line 163, in export
    _export(
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/utils.py", line 1074, in _export
    graph, params_dict, torch_out = _model_to_graph(
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/utils.py", line 731, in _model_to_graph
    graph = _optimize_graph(
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/utils.py", line 308, in _optimize_graph
    graph = _C._jit_pass_onnx(graph, operator_export_type)
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/__init__.py", line 416, in _run_symbolic_function
    return utils._run_symbolic_function(*args, **kwargs)
  File "/opt/conda/envs/train-test/lib/python3.8/site-packages/torch/onnx/utils.py", line 1421, in _run_symbolic_function
    raise symbolic_registry.UnsupportedOperatorError(
torch.onnx.symbolic_registry.UnsupportedOperatorError: Exporting the operator ::_transformer_encoder_layer_fwd to ONNX opset version 14 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.
@vitoplantamura
Copy link
Owner

vitoplantamura commented Mar 1, 2024 via email

@Peterzzz-hub
Copy link
Author

you should post this in the pytorch repo :-) In the past, I had a similar error, and I solved it by installing the most recent Pytorch nightly build. Vito
sry, i opend too many windows, i post by mistake. thx 4 ur reply

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