open-mmlab / mmdetection3d

OpenMMLab's next-generation platform for general 3D object detection.
https://mmdetection3d.readthedocs.io/en/latest/
Apache License 2.0
5.2k stars 1.53k forks source link

AttributeError: 'ConfigDict' object has no attribute 'nms' #1254

Closed EdAyers closed 2 years ago

EdAyers commented 2 years ago

This is a downstream case of this mmdet issue which was fixed by this merge request.

This was brought to my attention by running

python tools/test.py ./configs/nuimages/mask_rcnn_r50_caffe_fpn_coco-3x_20e_nuim.py $CHECKPOINTS/mask_rcnn_r50_caffe_fpn_coco-3x_20e_nuim_20201009_125002-5529442c.pth --show --show-dir ./out

Which yields

 AttributeError: 'ConfigDict' object has no attribute 'nms'

The offending lines are https://github.com/open-mmlab/mmdetection3d/blob/86cc487cca2eb332ad4e6adf2fff8c879ffc2115/configs/_base_/models/cascade_mask_rcnn_r50_fpn.py#L194 and https://github.com/open-mmlab/mmdetection3d/blob/86cc487cca2eb332ad4e6adf2fff8c879ffc2115/configs/_base_/models/cascade_mask_rcnn_r50_fpn.py#L133 using the old config, and I guess the old config got deprecated and this repo didn't update. Migration is described in https://github.com/open-mmlab/mmdetection/pull/4636. If I update this config locally then it fixes this error.

There is no issue on the mmdetection3d repo discussing this. The problem is present on master of this repo and at v18.1.0 tag No modifications have been made to configs. I am using the nuimages dataset.

Output of collect_env:

sys.platform: linux
Python: 3.7.10 (default, Feb 26 2021, 18:47:35) [GCC 7.3.0]
CUDA available: True
GPU 0,1: GeForce GTX 1080 Ti
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.2, V10.2.89
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.9.0
PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2021.2-Product Build 20210312 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.2
  - 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_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.5
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=7.6.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,

TorchVision: 0.10.0
OpenCV: 4.5.5
MMCV: 1.4.5
MMCV Compiler: GCC 7.5
MMCV CUDA Compiler: 10.2
MMDetection: 2.21.0
MMSegmentation: 0.21.1
MMDetection3D: 0.18.1+86cc487
wHao-Wu commented 2 years ago

Hi, @EdAyers ,

Thanks for your contribution. We will fix the problem asap. Or you are strongly welcomed to push your commit to our repo to make the repo greater.

Tai-Wang commented 2 years ago

Fixed by #1258.

mrtushartiwari commented 2 years ago

Is this fix released in latest pip versions? I am using print(mmdet.__version__) # 2.25.0 print(mmcv.__version__) # 1.5.3

and still facing the same issue.