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

Could not export onnx. #72

Closed
Domwis-IR opened this issue Oct 28, 2022 · 18 comments
Closed

Could not export onnx. #72

Domwis-IR opened this issue Oct 28, 2022 · 18 comments

Comments

@Domwis-IR
Copy link

I tried export.py but could not do it because it didn't get the right input.
2022-10-28 04:02:25,943 INFO ==> Loading parameters from checkpoint ./pointpillar_7728.pth to CPU

Traceback (most recent call last):
  File "exporter.py", line 150, in <module>
    main()
  File "exporter.py", line 134, in main
    output_names = ['cls_preds', 'box_preds', 'dir_cls_preds'], # the model's output names
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/onnx/__init__.py", line 365, in export
    export_modules_as_functions,
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/onnx/utils.py", line 178, in export
    export_modules_as_functions=export_modules_as_functions,
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/onnx/utils.py", line 1097, in _export
    dynamic_axes=dynamic_axes,
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/onnx/utils.py", line 737, in _model_to_graph
    graph, params, torch_out, module = _create_jit_graph(model, args)
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/onnx/utils.py", line 611, in _create_jit_graph
    graph, torch_out = _trace_and_get_graph_from_model(model, args)
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/onnx/utils.py", line 527, in _trace_and_get_graph_from_model
    model, args, strict=False, _force_outplace=False, _return_inputs_states=True
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/jit/_trace.py", line 1179, in _get_trace_graph
    outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/jit/_trace.py", line 134, in forward
    self._force_outplace,
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/jit/_trace.py", line 120, in wrapper
    outs.append(self.inner(*trace_inputs))
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/rjh1016/anaconda3/envs/openpcdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1118, in _slow_forward
    result = self.forward(*input, **kwargs)
**TypeError: forward() missing 1 required positional argument: 'batch_dict'**

I guess the model architecture is still same with the OpenPCDet. But I don't know what to do first to export onnx from this file.
My torch version is 1.12.1+cu102, cuda version is 11.3 and onnx version is 1.12.0

@rjwb1
Copy link

rjwb1 commented Nov 16, 2022

@Domwis-IR I am working on the same issue. Did you solve it?

@rjwb1
Copy link

rjwb1 commented Nov 30, 2022

@Domwis-IR this was due to using the wrong version of PCDet. To solve this I created a docker container with torch 1.8.1 and PCDet at the HEAD reference by the submodule

@Domwis-IR
Copy link
Author

Thank you so much with your reply. I will try too!

@jrb-cobot
Copy link

@rjwb1 could you share your Dockerfile?

@rjwb1
Copy link

rjwb1 commented Apr 3, 2023

@jrb-cobot find here, I had to modify it slightly as I have a customised workflow but hope this helps

4bcb924

#77

@The-wind-rises-2023
Copy link

The-wind-rises-2023 commented May 18, 2023

@Domwis-IR this was due to using the wrong version of PCDet. To solve this I created a docker container with torch 1.8.1 and PCDet at the HEAD reference by the submodule
@rjwb1 I built the image using the dockerfile you provided, and used the container created from the image . But the command "python exporter.py --ckpt pointpillar_7728.pth"could not do it.Could you provide some help?

@rjwb1
Copy link

rjwb1 commented May 18, 2023

@Domwis-IR this was due to using the wrong version of PCDet. To solve this I created a docker container with torch 1.8.1 and PCDet at the HEAD reference by the submodule
@rjwb1 I built the image using the dockerfile you provided, and used the container created from the image . But the command "python exporter.py --ckpt pointpillar_7728.pth"could not do it.Could you provide some help?

Could you provide more information about the issue? Perhaps the traceback

@The-wind-rises-2023
Copy link

@rjwb1 Thanks for your replytation! I uesd your dockerfile for builting container and then solved problem.Thanks!

@QiXueZhong
Copy link

@Domwis-IR this was due to using the wrong version of PCDet. To solve this I created a docker container with torch 1.8.1 and PCDet at the HEAD reference by the submodule
@rjwb1 I built the image using the dockerfile you provided, and used the container created from the image . But the command "python exporter.py --ckpt pointpillar_7728.pth"could not do it.Could you provide some help?

Could you provide more information about the issue? Perhaps the traceback

May I ask what environment your docker is in? x86 or Xavier/Orin?

@QiXueZhong
Copy link

@Domwis-IR this was due to using the wrong version of PCDet. To solve this I created a docker container with torch 1.8.1 and PCDet at the HEAD reference by the submodule
@rjwb1 I built the image using the dockerfile you provided, and used the container created from the image . But the command "python exporter.py --ckpt pointpillar_7728.pth"could not do it.Could you provide some help?

Could you provide more information about the issue? Perhaps the traceback

image
the wrong message

@rjwb1
Copy link

rjwb1 commented May 23, 2023

This docker file is for x86. Please check the README.md inside the docker directory for usage

@The-wind-rises-2023
Copy link

@Domwis-IR this was due to using the wrong version of PCDet. To solve this I created a docker container with torch 1.8.1 and PCDet at the HEAD reference by the submodule
@rjwb1 I built the image using the dockerfile you provided, and used the container created from the image . But the command "python exporter.py --ckpt pointpillar_7728.pth"could not do it.Could you provide some help?

Could you provide more information about the issue? Perhaps the traceback

image the wrong message

You can modify the last two lines in your Dockerfile(add "-c"),like this:
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/bin/bash", "-c"]

@jrb-cobot
Copy link

I'm still working on this issue. I'd like to keep to the current version of OpenPCDet so that I can use the latest models and features. If anyone has made progress using version 0.6.0+, please let me know.

@Anutlet
Copy link

Anutlet commented Jan 5, 2024

I'm still working on this issue. I'd like to keep to the current version of OpenPCDet so that I can use the latest models and features. If anyone has made progress using version 0.6.0+, please let me know.

Do you have any progress? I can't find the difference that led to the problem between v0.5 and v0.6. I'm looking forward to your reply. Thank you very much!

@xixioba
Copy link

xixioba commented Aug 19, 2024

Is there any progress about openPCDet v0.6?

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

8 participants
@Anutlet @xixioba @Domwis-IR @rjwb1 @QiXueZhong @jrb-cobot @The-wind-rises-2023 and others