Open LittleWhitemi opened 1 year ago
Hi @LittleWhitemi, since operators such as RotatedRoIAlign do not support calculating FLOPS, FLOPS cannot be calculated in the two-stage detectors.
Hi @LittleWhitemi, since operators such as RotatedRoIAlign do not support calculating FLOPS, FLOPS cannot be calculated in the two-stage detectors.
How can I calculate FLOPS in the two-stage detectors?
Prerequisite
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
1.x branch https://github.com/open-mmlab/mmrotate/tree/1.x
Environment
System environment: sys.platform: win32 Python: 3.9.16 (main, Mar 8 2023, 10:39:24) [MSC v.1916 64 bit (AMD64)] CUDA available: True numpy_random_seed: 451610591 GPU 0: NVIDIA GeForce RTX 3060 Laptop GPU CUDA_HOME: D:\Program Files (x86)\NVIDA GPU Computing Toolkit\CUDA\v11.6 NVCC: Cuda compilation tools, release 11.6, V11.6.124 MSVC: ���� x64 �� Microsoft (R) C/C++ �Ż������� 19.35.32215 �� GCC: n/a PyTorch: 1.12.1 PyTorch compiling details: PyTorch built with:
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.6, CUDNN_VERSION=8.3.2, CXX_COMPILER=C:/cb/pytorch_1000000000000/work/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/cb/pytorch_1000000000000/work/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.12.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF,
TorchVision: 0.13.1 OpenCV: 4.7.0 MMEngine: 0.7.2
Reproduces the problem - code sample
Reproduces the problem - command or script
Traceback (most recent call last): File "D:\documentation\study\ships_detection\Rotated Detector\mmrotatesar_1.x\tools\analysis_tools\get_flops.py", line 88, in
main()
File "D:\documentation\study\ships_detection\Rotated Detector\mmrotatesar_1.x\tools\analysis_tools\get_flops.py", line 73, in main
flops, params = get_model_complexity_info(model, input_shape)
File "D:\APP\Anaconda3\envs\mmrotate1.x\lib\site-packages\mmcv\cnn\utils\flops_counter.py", line 107, in get_model_complexityinfo
= flops_model(batch)
File "D:\APP\Anaconda3\envs\mmrotate1.x\lib\site-packages\torch\nn\modules\module.py", line 1148, in _call_impl
result = forward_call(*input, **kwargs)
File "d:\documentation\study\ships_detection\object detection\mmdetection3.x\mmdetection\mmdet\models\detectors\base.py", line 96, in forward
return self._forward(inputs, data_samples) File "d:\documentation\study\ships_detection\object detection\mmdetection3.x\mmdetection\mmdet\models\detectors\two_stage.py", line 134, in _forward rpn_results_list = self.rpn_head.predict( File "d:\documentation\study\ships_detection\object detection\mmdetection3.x\mmdetection\mmdet\models\dense_heads\base_dense_head.py", line 191, in predict batch_img_metas = [ TypeError: 'NoneType' object is not iterable
Reproduces the problem - error message
TypeError: 'NoneType' object is not iterable
Additional information
when I use
python tools\analysis_tools\get_flops.py configs\rotated_fcos\rotated-fcos-hbox-le90_r50_fpn_1x_dota.py
, I got right result. However,when I use ``python tools\analysis_tools\get_flops.py configs\roi_trans\roi-trans-le90_r50_fpn_1x_dota.py```, there are "TypeError: 'NoneType' object is not iterable"