Repository: open-mmlab/mmdetection

Issue:
[Bug] faster-rcnn_r50-caffe_fpn_ms-2x and 3x don't work 
### Prerequisite

- [X] I have searched [Issues](https://github.com/open-mmlab/mmdetection/issues) and [Discussions](https://github.com/open-mmlab/mmdetection/discussions) but cannot get the expected help.
- [X] I have read the [FAQ documentation](https://mmdetection.readthedocs.io/en/latest/faq.html) but cannot get the expected help.
- [X] The bug has not been fixed in the [latest version (master)](https://github.com/open-mmlab/mmdetection) or [latest version (3.x)](https://github.com/open-mmlab/mmdetection/tree/dev-3.x).

### Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

### Branch

3.x branch https://github.com/open-mmlab/mmdetection/tree/3.x

### Environment

OrderedDict([('sys.platform', 'linux'),
             ('Python', '3.7.15 (default, Oct 12 2022, 19:14:55) [GCC 7.5.0]'),
             ('CUDA available', True),
             ('numpy_random_seed', 2147483648),
             ('GPU 0', 'Tesla T4'),
             ('CUDA_HOME', '/usr/local/cuda'),
             ('NVCC', 'Cuda compilation tools, release 11.2, V11.2.152'),
             ('GCC',
              'x86_64-linux-gnu-gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0'),
             ('PyTorch', '1.9.0+cu111'),
             ('PyTorch compiling details',
              'PyTorch built with:\n  - GCC 7.3\n  - C++ Version: 201402\n  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications\n  - Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)\n  - OpenMP 201511 (a.k.a. OpenMP 4.5)\n  - NNPACK is enabled\n  - CPU capability usage: AVX2\n  - CUDA Runtime 11.1\n  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86\n  - CuDNN 8.0.5\n  - Magma 2.5.2\n  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, \n'),
             ('TorchVision', '0.10.0+cu111'),
             ('OpenCV', '4.6.0'),
             ('MMEngine', '0.3.0'),
             ('MMDetection', '2.25.3+5b0d5b4')])

### Reproduces the problem - code sample
（the other models work well）
```python
!mim download mmdet --config faster-rcnn_r50-caffe_fpn_ms-2x_coco --dest ./checkpoints
```
and then we see 
`faster_rcnn_r50_caffe_fpn_mstrain_2x_coco_bbox_mAP-0.397_20200504_231813-10b2de58.pth`  or `faster_rcnn_r50_caffe_fpn_mstrain_3x_coco_20210526_095054-1f77628b`



### Reproduces the problem - command or script

``` python
from mmdet.apis import init_detector, inference_detector
from mmdet.utils import register_all_modules
from mmdet.registry import VISUALIZERS
import mmcv
register_all_modules()
config_file = './checkpoints/faster-rcnn_r50-caffe_fpn_ms-2x_coco.py'
checkpoint_file = './checkpoints/faster_rcnn_r50_caffe_fpn_mstrain_2x_coco_bbox_mAP-0.397_20200504_231813-10b2de58.pth'

model = init_detector(config_file, checkpoint_file, device='cpu')  # or device='cuda:0'
image = mmcv.imread( "demo/demo.jpg", channel_order='rgb')
result = inference_detector(model, image)

print(result)
```


### Reproduces the problem - error message

and i see:
```
local loads checkpoint from path: ./checkpoints/faster_rcnn_r50_caffe_fpn_mstrain_2x_coco_bbox_mAP-0.397_20200504_231813-10b2de58.pth
<DetDataSample(

    META INFORMATION
    img_path: None
    pad_shape: (800, 1216)
    scale_factor: (1.8734375, 1.873536299765808)
    img_id: 0
    ori_shape: (427, 640)
    batch_input_shape: (800, 1216)
    img_shape: (800, 1199)

    DATA FIELDS
    gt_instances: <InstanceData(
        
            META INFORMATION
        
            DATA FIELDS
            labels: tensor([], dtype=torch.int64)
            bboxes: tensor([], size=(0, 4))
        ) at 0x7f8e7cabc150>
    _ignored_instances: <InstanceData(
        
            META INFORMATION
        
            DATA FIELDS
            labels: tensor([], dtype=torch.int64)
            bboxes: tensor([], size=(0, 4))
        ) at 0x7f8e7cabce90>
    _pred_instances: <InstanceData(
        
            META INFORMATION
        
            DATA FIELDS
            scores: tensor([])
            labels: tensor([], dtype=torch.int64)
            bboxes: tensor([], size=(0, 4))
        ) at 0x7f8e7f14b190>
    _gt_instances: <InstanceData(
        
            META INFORMATION
        
            DATA FIELDS
            labels: tensor([], dtype=torch.int64)
            bboxes: tensor([], size=(0, 4))
        ) at 0x7f8e7cabc150>
```

All results are empty.

### Additional information

_No response_


Discussion:
seems like a bug, we will try tp reproduce your issues.
> seems like a bug, we will try tp reproduce your issues.

OK, Thank you.
We repeated the mistake, and find replace the config file with `faster-rcnn_r50-caffe_fpn_1x_coco.py` which will work. 
![image](https://user-images.githubusercontent.com/40661020/201570916-cb3c42ef-d1b6-450a-a98b-bf8fc941b462.png)


Resolving patch:
diff --git a/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-1x_coco.py b/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-1x_coco.py
--- a/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-1x_coco.py
+++ b/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-1x_coco.py
@@ -1,5 +1,11 @@
 _base_ = './faster-rcnn_r50_fpn_1x_coco.py'
 model = dict(
+    data_preprocessor=dict(
+        type='DetDataPreprocessor',
+        mean=[103.530, 116.280, 123.675],
+        std=[1.0, 1.0, 1.0],
+        bgr_to_rgb=False,
+        pad_size_divisor=32),
     backbone=dict(
         norm_cfg=dict(requires_grad=False),
         norm_eval=True,
diff --git a/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-3x_coco.py b/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-3x_coco.py
--- a/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-3x_coco.py
+++ b/configs/faster_rcnn/faster-rcnn_r50-caffe_fpn_ms-3x_coco.py
@@ -1,5 +1,11 @@
 _base_ = 'faster-rcnn_r50_fpn_ms-3x_coco.py'
 model = dict(
+    data_preprocessor=dict(
+        type='DetDataPreprocessor',
+        mean=[103.530, 116.280, 123.675],
+        std=[1.0, 1.0, 1.0],
+        bgr_to_rgb=False,
+        pad_size_divisor=32),
     backbone=dict(
         norm_cfg=dict(requires_grad=False),
         norm_eval=True,


Test patch: