OnnxStream
OnnxStream copied to clipboard
UnsupportedOperatorError: Exporting the operator ::_transformer_encoder_layer_fwd to ONNX opset
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.
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
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