HuangJunJie2017 / BEVDet

Code base of the BEVDet series .
Apache License 2.0
1.45k stars 265 forks source link

benchmark_trt.py AssertionError #293

Open linClubs opened 1 year ago

linClubs commented 1 year ago

Hello Dr. Huang, Bevdet is an excellent work! I run benchmark_trt.py error。

python tools/analysis_tools/benchmark_trt.py configs/bevdet/bevdet-r50.py work_dir/bevdet_fp16_fuse.engine

the terminal show as follow,how do I fix it? thanks

(bevdet) lin@PC:~/code/bevdetv2.1/BEVDet$ python tools/analysis_tools/benchmark_trt.py configs/bevdet/bevdet-r50.py work_dir/bevdet_fp16_fuse.engine 
2023-09-15 16:34:52,640 - mmdeploy - INFO - Successfully loaded tensorrt plugins from /home/lin/code/bevdetv2.1/BEVDet/third_party/mmdeploy/build/lib/libmmdeploy_tensorrt_ops.so
/home/lin/software/miniconda3/envs/bevdet/lib/python3.8/site-packages/mmdet/models/backbones/resnet.py:401: UserWarning: DeprecationWarning: pretrained is deprecated, please use "init_cfg" instead
  warnings.warn('DeprecationWarning: pretrained is deprecated, '
[09/15/2023-16:34:53] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage. See `CUDA_MODULE_LOADING` in https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
tools/analysis_tools/benchmark_trt.py:78: DeprecationWarning: Use get_tensor_mode instead.
  input_names = list(filter(self.engine.binding_is_input, names))
/home/lin/code/bevdetv2.1/BEVDet/mmdet3d/datasets/pipelines/loading.py:1081: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at  ../torch/csrc/utils/tensor_new.cpp:201.)
  gt_boxes, gt_labels = torch.Tensor(gt_boxes), torch.tensor(gt_labels)
/home/lin/code/bevdetv2.1/BEVDet/mmdet3d/models/necks/view_transformer.py:218: UserWarning: torch.range is deprecated and will be removed in a future release because its behavior is inconsistent with Python's range builtin. Instead, use torch.arange, which produces values in [start, end).
  ranks_depth = torch.range(
/home/lin/code/bevdetv2.1/BEVDet/mmdet3d/models/necks/view_transformer.py:220: UserWarning: torch.range is deprecated and will be removed in a future release because its behavior is inconsistent with Python's range builtin. Instead, use torch.arange, which produces values in [start, end).
  ranks_feat = torch.range(
/home/lin/code/bevdetv2.1/BEVDet/mmdet3d/models/necks/view_transformer.py:228: UserWarning: torch.range is deprecated and will be removed in a future release because its behavior is inconsistent with Python's range builtin. Instead, use torch.arange, which produces values in [start, end).
  batch_idx = torch.range(0, B - 1).reshape(B, 1). \
tools/analysis_tools/benchmark_trt.py:89: DeprecationWarning: Use get_tensor_name instead.
  idx = self.engine.get_binding_index(input_name)
tools/analysis_tools/benchmark_trt.py:90: DeprecationWarning: Use set_input_shape instead.
  self.context.set_binding_shape(idx, tuple(input_tensor.shape))
tools/analysis_tools/benchmark_trt.py:96: DeprecationWarning: Use get_tensor_name instead.
  idx = self.engine.get_binding_index(output_name)
tools/analysis_tools/benchmark_trt.py:97: DeprecationWarning: Use get_tensor_dtype instead.
  dtype = torch_dtype_from_trt(self.engine.get_binding_dtype(idx))
tools/analysis_tools/benchmark_trt.py:98: DeprecationWarning: Use get_tensor_shape instead.
  shape = tuple(self.context.get_binding_shape(idx))
Done image [100/ 500], fps: 464.35 img / s
Done image [150/ 500], fps: 465.49 img / s
Traceback (most recent call last):
  File "tools/analysis_tools/benchmark_trt.py", line 220, in <module>
    fps = main()
  File "tools/analysis_tools/benchmark_trt.py", line 207, in main
    assert args.eval
AssertionError
linClubs commented 1 year ago

Excuse me, I have already resolved it.

Yunge6666 commented 11 months ago

Excuse me, I have already resolved it.

Hello, I have the same problem, can you tell me how you solve it?