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

bug? #23

Closed
intjun opened this issue Aug 17, 2022 · 4 comments
Closed

bug? #23

intjun opened this issue Aug 17, 2022 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@intjun
Copy link

intjun commented Aug 17, 2022

Traceback (most recent call last):
File "convert_to_onnx.py", line 71, in
main()
File "convert_to_onnx.py", line 36, in main
torch.onnx.export(
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/onnx/init.py", line 225, in export
return utils.export(model, args, f, export_params, verbose, training,
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/onnx/utils.py", line 85, in export
_export(model, args, f, export_params, verbose, training, input_names, output_names,
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/onnx/utils.py", line 632, in _export
_model_to_graph(model, args, verbose, input_names,
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/onnx/utils.py", line 409, in _model_to_graph
graph, params, torch_out = _create_jit_graph(model, args,
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/onnx/utils.py", line 379, in _create_jit_graph
graph, torch_out = _trace_and_get_graph_from_model(model, args)
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/onnx/utils.py", line 342, in _trace_and_get_graph_from_model
torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/jit/_trace.py", line 1148, in _get_trace_graph
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/jit/_trace.py", line 125, in forward
graph, out = torch._C._create_graph_by_tracing(
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/jit/_trace.py", line 116, in wrapper
outs.append(self.inner(*trace_inputs))
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/nn/modules/module.py", line 725, in _call_impl
result = self._slow_forward(*input, **kwargs)
File "/root/anaconda3/envs/eys/lib/python3.8/site-packages/torch/nn/modules/module.py", line 709, in _slow_forward
result = self.forward(*input, **kwargs)
TypeError: forward() missing 7 required positional arguments: 'scores0', 'keypoints0', 'descriptors0', 'image1_shape', 'scores1', 'keypoints1', and 'descriptors1'

@xmba15
Copy link
Owner

xmba15 commented Aug 17, 2022

@intjun I assume you are mentioning the convert script for superglue.
Can you share info about the environments?

I tested the script with

torch: 1.12.0
onnxruntime: 1.12.1
opencv: 4.1.2

Did you install the dependencies with the requirements.txt I mentioned?

@intjun
Copy link
Author

intjun commented Aug 17, 2022

OK, I'll try. Thank you very much!

torch 1.11.0
onnxruntime 1.11.1
opencv-python 4.1.2.30

@xmba15 xmba15 added the question Further information is requested label Aug 17, 2022
@xmba15 xmba15 self-assigned this Aug 17, 2022
@xmba15
Copy link
Owner

xmba15 commented Aug 17, 2022

@intjun Have you got it working?
btw, my code did have a bug in nms part. I fixed it and the result for superglue is way better now.

@xmba15 xmba15 closed this as completed Aug 19, 2022
@intjun
Copy link
Author

intjun commented Aug 30, 2022

@intjun Have you got it working? btw, my code did have a bug in nms part. I fixed it and the result for superglue is way better now.

yes,i got it work.Thank you very much.But I want to use tensorrt as the back-end of onnx to run superglue. There are some problems and it cannot run. If you have time, please help me. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants