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

convert to onnx failed #5

Open
ztpaul opened this issue Mar 4, 2020 · 0 comments
Open

convert to onnx failed #5

ztpaul opened this issue Mar 4, 2020 · 0 comments

Comments

@ztpaul
Copy link

ztpaul commented Mar 4, 2020

Traceback (most recent call last):
File "/mnt/hgfs/vmshare/myssd/to_onnx.py", line 17, in
torch.onnx.export(net, dummy_input, "myssd.onnx")
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/onnx/init.py", line 148, in export
strip_doc_string, dynamic_axes, keep_initializers_as_inputs)
File "/home/ballzb/.local/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/ballzb/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 416, in _export
fixed_batch_size=fixed_batch_size)
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 279, in _model_to_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args, training)
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/onnx/utils.py", line 236, in _trace_and_get_graph_from_model
trace_graph, torch_out, inputs_states = torch.jit._get_trace_graph(model, args, _force_outplace=True, _return_inputs_states=True)
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/jit/init.py", line 277, in _get_trace_graph
outs = ONNXTracedModule(f, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/jit/init.py", line 360, in forward
self._force_outplace,
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/jit/init.py", line 347, in wrapper
outs.append(self.inner(*trace_inputs))
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 530, in call
result = self._slow_forward(*input, **kwargs)
File "/home/ballzb/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 516, in slow_forward
result = self.forward(*input, **kwargs)
File "/mnt/hgfs/vmshare/myssd/ssd_mobilenetv2.py", line 128, in forward
self.priors.type(type(x.data)) # default boxes
File "/mnt/hgfs/vmshare/myssd/ssd_mobilenetv2.py", line 172, in my_detect
ids, count = nms(boxes, scores, nms_thresh, top_k)
File "/mnt/hgfs/vmshare/myssd/layers/box_utils.py", line 194, in nms
keep = scores.new(scores.size(0)).zero
().long()
TypeError: expected Float (got Long)

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

1 participant