RuntimeError: input_shape_value == reshape_value || input_shape_value == 1 || reshape_value == 1INTERNAL ASSERT FAILED at "..\\torch\\csrc\\jit\\passes\\onnx\\shape_type_inference.cpp
":520, please report a bug to PyTorch. ONNX Expand input shape constraint not satisfied.
提示:这里描述项目中遇到的问题:
模型在转onnx的时候遇到的错误,在git上查找到相同的错误,但也没有明确的解决方式,有哪位大佬帮忙解答一下
Traceback (most recent call last):
File "tools\deployment\pytorch2onnx.py", line 165, in <module>
pytorch2onnx(
File "tools\deployment\pytorch2onnx.py", line 68, in pytorch2onnx
torch.onnx.export(
File "D:\miniconda3\lib\site-packages\torch\onnx\__init__.py", line 275, in export
return utils.export(model, args, f, export_params, verbose, training,
File "D:\miniconda3\lib\site-packages\torch\onnx\utils.py", line 88, in export
_export(model, args, f, export_params, verbose, training, input_names, output_names,
File "D:\miniconda3\lib\site-packages\torch\onnx\utils.py", line 689, in _export
_model_to_graph(model, args, verbose, input_names,
File "D:\miniconda3\lib\site-packages\torch\onnx\utils.py", line 463, in _model_to_graph
graph = _optimize_graph(graph, operator_export_type,
File "D:\miniconda3\lib\site-packages\torch\onnx\utils.py", line 200, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
File "D:\miniconda3\lib\site-packages\torch\onnx\__init__.py", line 313, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "D:\miniconda3\lib\site-packages\torch\onnx\utils.py", line 994, in _run_symbolic_function
return symbolic_fn(g, *inputs, **attrs)
File "D:\miniconda3\lib\site-packages\torch\onnx\symbolic_opset9.py", line 473, in expand_as
return g.op("Expand", self, shape)
File "D:\miniconda3\lib\site-packages\torch\onnx\utils.py", line 890, in _graph_op
torch._C._jit_pass_onnx_node_shape_type_inference(n, _params_dict, opset_version)
RuntimeError: input_shape_value == reshape_value || input_shape_value == 1 || reshape_value == 1INTERNAL ASSERT FAILED at "..\\torch\\csrc\\jit\\passes\\onnx\\shape_type_inference.cpp
":520, please report a bug to PyTorch. ONNX Expand input shape constraint not satisfied.
无
暂时没有