NVIDIA-AI-IOT / CUDA-PointPillars

A project demonstrating how to use CUDA-PointPillars to deal with cloud points data from lidar.
Apache License 2.0
503 stars 148 forks source link

Got TracerWarnings converting a new onnx file and then got errors running the demo #41

Open WangHeng1021 opened 2 years ago

WangHeng1021 commented 2 years ago

Hey guys, I use cuda 11.4 cudnn 8.2.4 tensorrt 8.4.0.6 onnx 1.11.0 I downloaded the .pth file and tried to convert a new onnx file with tool/exporter.py. Got the warnings below:

2022-05-13 17:43:39,263 INFO ------ Convert OpenPCDet model for TensorRT ------ /home/wh/anaconda3/envs/whenv2/lib/python3.9/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1646756402876/work/aten/src/ATen/native/TensorShape.cpp:2228.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] 2022-05-13 17:43:41,578 INFO ==> Loading parameters from checkpoint ./pointpillar_7728.pth to CPU 2022-05-13 17:43:41,610 INFO ==> Done (loaded 127/127) /home/wh/anaconda3/envs/whenv2/lib/python3.9/site-packages/torch/onnx/utils.py:366: UserWarning: Skipping _decide_input_format -1 warnings.warn("Skipping _decide_input_format\n {}".format(e.args[0])) /home/wh/gitstorage/CUDA-PointPillars/OpenPCDet/pcdet/models/backbones_3d/vfe/pillar_vfe.py:30: TracerWarning: Converting a tensor to a Python boolean 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! if inputs.shape[0] > self.part: /home/wh/gitstorage/CUDA-PointPillars/OpenPCDet/pcdet/models/backbones_2d/map_to_bev/pointpillar_scatter.py:17: TracerWarning: Converting a tensor to a Python number 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! batch_size = coords[:, 0].max().int().item() + 1 /home/wh/gitstorage/CUDA-PointPillars/OpenPCDet/pcdet/models/backbones_2d/base_bev_backbone.py:95: 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! stride = int(spatial_features.shape[2] / x.shape[2]) /home/wh/gitstorage/CUDA-PointPillars/OpenPCDet/pcdet/models/detectors/detector3d_template.py:214: TracerWarning: Converting a tensor to a Python boolean 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! assert cls_preds.shape[1] in [1, self.num_class] /home/wh/gitstorage/CUDA-PointPillars/OpenPCDet/pcdet/models/model_utils/model_nms_utils.py:14: TracerWarning: Converting a tensor to a Python boolean 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! if box_scores.shape[0] > 0: /home/wh/anaconda3/envs/whenv2/lib/python3.9/site-packages/torch/onnx/utils.py:272: UserWarning: We detected that you are modifying a dictionary that is an input to your model. Note that dictionaries are allowed as inputs in ONNX but they should be handled with care. Usages of dictionaries is not recommended, and should not be used except for configuration use. Also note that the order and values of the keys must remain the same. warnings.warn(warning) Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Warning: Constant folding - Only steps=1 can be constant folded for opset >= 10 onnx::Slice op. Constant folding not applied. Use onnx_graphsurgeon to adjust postprocessing part in the onnx... Use onnx_graphsurgeon to modify onnx... finished exporting onnx 2022-05-13 17:43:48,895 INFO [PASS] ONNX EXPORTED.

Then, I moved the onnx file and parans.h to ../include/ as said in the README file. But I got the following erros:

GPU has cuda devices: 2 ----device id: 0 info---- GPU : NVIDIA GeForce RTX 2080 Capbility: 7.5 Global memory: 7979MB Const memory: 64KB SM in a block: 48KB warp size: 32 threads in a block: 1024 block dim: (1024,1024,64) grid dim: (2147483647,65535,65535) ----device id: 1 info---- GPU : NVIDIA GeForce RTX 2080 Capbility: 7.5 Global memory: 7982MB Const memory: 64KB SM in a block: 48KB warp size: 32 threads in a block: 1024 block dim: (1024,1024,64) grid dim: (2147483647,65535,65535)

Building TRT engine. trt_infer: [shuffleNode.cpp::symbolicExecute::391] Error Code 4: Internal Error (Reshape_249: IShuffleLayer applied to shape tensor must have 0 or 1 reshape dimensions: dimensions were [-1,2]) trt_infer: ModelImporter.cpp:792: While parsing node number 28 [Pad -> "input.67"]: trt_infer: ModelImporter.cpp:793: --- Begin node --- trt_infer: ModelImporter.cpp:794: input: "input.55" input: "onnx::Cast_451" input: "onnx::Pad_453" output: "input.67" name: "Pad_260" op_type: "Pad" attribute { name: "mode" s: "constant" type: STRING }

trt_infer: ModelImporter.cpp:795: --- End node --- trt_infer: ModelImporter.cpp:798: ERROR: ModelImporter.cpp:179 In function parseGraph: [6] Invalid Node - Pad_260 [shuffleNode.cpp::symbolicExecute::391] Error Code 4: Internal Error (Reshape_249: IShuffleLayer applied to shape tensor must have 0 or 1 reshape dimensions: dimensions were [-1,2]) : failed to parse onnx model file, please check the onnx version and trt support op!

Guys, please help me. T-T Thank you for your time!

byte-deve commented 2 years ago

There's no Pad node in the onnx. Could you confirm you're using the right path? Try with onnx file in the repo under /model?