Skip to content

use heatmaps = dsntnn.flat_softmax(unnormalized_heatmaps),when translate to ONNX,show error #31941

@mathpopo

Description

@mathpopo

%2212 : Float(56) = aten::linspace(%2200, %2204, %2191, %3099, %3100, %2210, %3101), scope: CoordRegressionNetwork # /home/anaconda3/envs/MobilePose-pytorch1/lib/python3.6/site-packages/dsntnn/init.py:61:0

/home/anaconda3/envs/MobilePose-pytorch1/lib/python3.6/site-packages/dsntnn/init.py:61: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
return torch.linspace(first, last, length, dtype=dtype, device=device)
/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/utils.py:617: UserWarning: ONNX export failed on ATen operator linspace because torch.onnx.symbolic_opset9.linspace does not exist
.format(op_name, opset_version, op_name))
Traceback (most recent call last):
File "/home/Downloads/MobilePose-pytorch-master/run_webcam.py", line 70, in
humans = e.inference(image)
File "/home/Downloads/MobilePose-pytorch-master/estimator.py", line 112, in inference
export_params=True)#, # store the trained parameter weights inside the model file
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/init.py", line 143, in export
strip_doc_string, dynamic_axes, keep_initializers_as_inputs)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/utils.py", line 66, in export
dynamic_axes=dynamic_axes, keep_initializers_as_inputs=keep_initializers_as_inputs)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/utils.py", line 382, in _export
fixed_batch_size=fixed_batch_size)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/utils.py", line 262, in _model_to_graph
fixed_batch_size=fixed_batch_size)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/utils.py", line 132, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/init.py", line 174, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/utils.py", line 618, in _run_symbolic_function
op_fn = sym_registry.get_registered_op(op_name, '', opset_version)
File "/home/anaconda3/envs/human-pose-estimation/lib/python3.6/site-packages/torch/onnx/symbolic_registry.py", line 91, in get_registered_op
return _registry[(domain, version)][opname]
KeyError: 'linspace'

cc @houseroad @spandantiwari @lara-hdr @BowenBao @neginraoof

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: onnxRelated to torch.onnxtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions