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

How to convert model to onnx? #31

Open
feiyun1265 opened this issue Aug 21, 2023 · 1 comment
Open

How to convert model to onnx? #31

feiyun1265 opened this issue Aug 21, 2023 · 1 comment

Comments

@feiyun1265
Copy link

When I convert torch model to onnx model, the following error occurred:
main()
File "convert_to_onnx.py", line 118, in main
torch.onnx.export(model, x, onnx_model_path,
File "\Python\Python310\site-packages\torch\onnx\utils.py", line 506, in export
_export(
File "\Python\Python310\site-packages\torch\onnx\utils.py", line 1548, in _export
graph, params_dict, torch_out = _model_to_graph(
File "\Python\Python310\site-packages\torch\onnx\utils.py", line 1117, in _model_to_graph
graph = _optimize_graph(
File "\Python\Python310\site-packages\torch\onnx\utils.py", line 665, in _optimize_graph
graph = _C._jit_pass_onnx(graph, operator_export_type)
File "\Python\Python310\site-packages\torch\onnx\utils.py", line 1891, in _run_symbolic_function
return symbolic_fn(graph_context, *inputs, **attrs)
File "\Python\Python310\site-packages\torch\onnx\symbolic_helper.py", line 306, in wrapper
return fn(g, *args, **kwargs)
File "\Python\Python310\site-packages\deform_conv2d_onnx_exporter.py", line 655, in deform_conv2d
dcn_params = create_dcn_params(input, weight, offset, mask, bias,
File "\Python\Python310\site-packages\deform_conv2d_onnx_exporter.py", line 568, in create_dcn_params
in_h = get_tensor_dim_size(input, 2) + 2 * (pad_h + additional_pad_h)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
(Occurred when translating deform_conv2d).

How to solve this problem, thank you!

@wangjiarui12
Copy link

Have you solved this problem?

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