Open acg93-pixel opened 1 year ago
Sketchy workaround for FCOS3D:
change line 90 of the mmdet3d/models/detectors/single_stage_mono3d.py from
batch_imgs = batch_inputs_dict['imgs']
to
batch_imgs = batch_inputs_dict
Thanks, got the result for FCOS3D. When running for SMOKE, I'm getting a tensor mismatch error:
Traceback (most recent call last):
File "tools/analysis_tools/get_flops.py", line 90, in
Prerequisite
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
main branch https://github.com/open-mmlab/mmdetection3d
Environment
TorchVision: 0.15.2+cu117 OpenCV: 4.7.0 MMEngine: 0.7.3 MMDetection: 3.0.0 MMDetection3D: 1.1.0+47e56e1 spconv2.0: False
Reproduces the problem - code sample
no sample code, using get_flops.py script
Reproduces the problem - command or script
python tools/analysis_tools/get_flops.py configs/smoke/smoke_dla34_dlaneck_gn-all_4xb8-6x_kitti-mono3d.py --shape 1920 500 --modality image
python tools/analysis_tools/get_flops.py configs/fcos3d/fcos3d_r101-caffe-dcn_fpn_head-gn_8xb2-1x_nus-mono3d.py --shape 1920 500 --modality image
Reproduces the problem - error message
Traceback (most recent call last): File "tools/analysis_tools/get_flops.py", line 83, in
main()
File "tools/analysis_tools/get_flops.py", line 73, in main
flops, params = get_model_complexity_info(model, input_shape)
File "/home/admin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/cnn/utils/flops_counter.py", line 107, in get_model_complexityinfo
= flops_model(batch)
File "/home/admin/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1538, in _call_impl
result = forward_call(*args, **kwargs)
File "/home/admin/work/object_detection/mmdetection/mmdet/models/detectors/base.py", line 96, in forward
return self._forward(inputs, data_samples)
File "/home/admin/work/object_detection/mmdetection/mmdet/models/detectors/single_stage.py", line 132, in _forward
x = self.extract_feat(batch_inputs)
File "/home/admin/work/object_detection/mmdetection3d/mmdet3d/models/detectors/single_stage_mono3d.py", line 90, in extract_feat
batch_imgs = batch_inputs_dict['imgs']
TypeError: new(): invalid data type 'str'
Additional information
I'm interesetd in FCOS3D and SMOKE models complexity for this input resolution but I cannot reproduce this script's result as in: https://github.com/open-mmlab/mmdetection3d/pull/736#issuecomment-878772280
Please help, thanks!