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 TesorRT #21

Open
monologuesmw opened this issue Aug 29, 2024 · 0 comments
Open

How to convert TesorRT #21

monologuesmw opened this issue Aug 29, 2024 · 0 comments

Comments

@monologuesmw
Copy link

I trained the cas-unireplknet-l-fpn model. When I use mmdeploy to convert tensorRT, I get an error like this.

Traceback (most recent call last): File "/miniconda/envs/mmdet_v228/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/miniconda/envs/mmdet_v228/lib/python3.8/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in __call__ ret = func(*args, **kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/pytorch2onnx.py", line 98, in torch2onnx export( File "/home/data/Code/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 356, in _wrap return self.call_function(func_name_, *args, **kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 326, in call_function return self.call_function_local(func_name, *args, **kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 275, in call_function_local return pipe_caller(*args, **kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in __call__ ret = func(*args, **kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/onnx/export.py", line 122, in export torch.onnx.export( File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/__init__.py", line 316, in export return utils.export(model, args, f, export_params, verbose, training, File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/utils.py", line 107, in export _export(model, args, f, export_params, verbose, training, input_names, output_names, File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/utils.py", line 724, in _export _model_to_graph(model, args, verbose, input_names, File "/home/data/Code/mmdeploy/mmdeploy/core/rewriters/rewriter_utils.py", line 402, in wrapper return self.func(self, *args, **kwargs) File "/home/data/Code/mmdeploy/mmdeploy/apis/onnx/optimizer.py", line 10, in model_to_graph__custom_optimizer graph, params_dict, torch_out = ctx.origin_func(*args, **kwargs) File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/utils.py", line 497, in _model_to_graph graph = _optimize_graph(graph, operator_export_type, File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/utils.py", line 216, in _optimize_graph graph = torch._C._jit_pass_onnx(graph, operator_export_type) File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/__init__.py", line 373, in _run_symbolic_function return utils._run_symbolic_function(*args, **kwargs) File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/utils.py", line 1032, in _run_symbolic_function return symbolic_fn(g, *inputs, **attrs) File "/miniconda/envs/mmdet_v228/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 158, in wrapper assert len(arg_descriptors) >= len(args) AssertionError 2024-08-29 16:36:03,513 - mmdeploy - ERROR - mmdeploy.apis.pytorch2onnx.torch2onnx with Call id: 0 failed. exit.

I tried to use reparameterize.py and then convert tensorRT , but got the same error.

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