You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello author, may I ask if your model can transfer onnx? There will be an error when I use this model to transfer onnx
Traceback (most recent call last):
File "To_onnx.py", line 65, in
torch.onnx.export(model, x, 'best.onnx', input_names=input_names, opset_version=15, output_names=output_names, verbose='False')
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/init.py", line 350, in export
return utils.export(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 163, in export
_export(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 1074, in _export
graph, params_dict, torch_out = _model_to_graph(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 731, in _model_to_graph
graph = _optimize_graph(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 308, in _optimize_graph
graph = _C._jit_pass_onnx(graph, operator_export_type)
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/init.py", line 416, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 1406, in _run_symbolic_function
return symbolic_fn(g, *inputs, **attrs)
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 219, in wrapper
args = [
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 220, in
_parse_arg(arg, arg_desc, arg_name, fn_name) # type: ignore[assignment]
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 97, in _parse_arg
raise RuntimeError(
RuntimeError: Failed to export an ONNX attribute 'onnx::Cast', since it's not constant, please try to make things (e.g., kernel size) static if possible
The text was updated successfully, but these errors were encountered:
Hello author, may I ask if your model can transfer onnx? There will be an error when I use this model to transfer onnx
Traceback (most recent call last):
File "To_onnx.py", line 65, in
torch.onnx.export(model, x, 'best.onnx', input_names=input_names, opset_version=15, output_names=output_names, verbose='False')
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/init.py", line 350, in export
return utils.export(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 163, in export
_export(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 1074, in _export
graph, params_dict, torch_out = _model_to_graph(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 731, in _model_to_graph
graph = _optimize_graph(
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 308, in _optimize_graph
graph = _C._jit_pass_onnx(graph, operator_export_type)
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/init.py", line 416, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/utils.py", line 1406, in _run_symbolic_function
return symbolic_fn(g, *inputs, **attrs)
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 219, in wrapper
args = [
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 220, in
_parse_arg(arg, arg_desc, arg_name, fn_name) # type: ignore[assignment]
File "/home/iv/miniconda3/envs/dxw/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 97, in _parse_arg
raise RuntimeError(
RuntimeError: Failed to export an ONNX attribute 'onnx::Cast', since it's not constant, please try to make things (e.g., kernel size) static if possible
The text was updated successfully, but these errors were encountered: