Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wang-boyu opened this issue Jun 2, 2021 · 7 comments · Fixed by #899
Closed

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

wang-boyu opened this issue Jun 2, 2021 · 7 comments · Fixed by #899

Comments

@wang-boyu
Copy link

Describe the bug

AttributeError when running SpatioTemporal Action Detection Video Demo.

Reproduction

  1. What command or script did you run?
  • same command as in the demo readme:
python demo/demo_spatiotemporal_det.py --video demo/demo.mp4 \
    --config configs/detection/ava/slowonly_omnisource_pretrained_r101_8x8x1_20e_ava_rgb.py \
    --checkpoint https://download.openmmlab.com/mmaction/detection/ava/slowonly_omnisource_pretrained_r101_8x8x1_20e_ava_rgb/slowonly_omnisource_pretrained_r101_8x8x1_20e_ava_rgb_20201217-16378594.pth \
    --det-config demo/faster_rcnn_r50_fpn_2x_coco.py \
    --det-checkpoint http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth \
    --det-score-thr 0.9 \
    --action-score-thr 0.5 \
    --label-map demo/label_map_ava.txt \
    --predict-stepsize 8 \
    --output-stepsize 4 \
    --output-fps 6
  1. Did you make any modifications on the code or config? Did you understand what you have modified?
  • no modification to anything
  1. What dataset did you use?
  • demo/demo.mp4

Environment

  1. Please run PYTHONPATH=${PWD}:$PYTHONPATH python mmaction/utils/collect_env.py to collect necessary environment information and paste it here.
sys.platform: linux
Python: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
CUDA available: True
GPU 0: A100-PCIE-40GB
CUDA_HOME: None
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.8.1+cu111
PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.7.0 (Git Hash 7aed236906b1f7a05c0917e5257a1af05e9ff683)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.1
  - 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
  - CuDNN 8.0.5
  - Magma 2.5.2
  - 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 -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.8.1, 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.9.1+cu111
OpenCV: 4.5.2
MMCV: 1.3.5
MMCV Compiler: GCC 7.3
MMCV CUDA Compiler: 11.1
MMAction2: 0.15.0+529f454
  1. You may add addition that may be helpful for locating the problem, such as
    • How you installed PyTorch [e.g., pip, conda, source]
      • pip
    • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

Error traceback

If applicable, paste the error traceback here.

Traceback (most recent call last):
  File "demo/demo_spatiotemporal_det.py", line 410, in <module>
    main()
  File "demo/demo_spatiotemporal_det.py", line 314, in main
    human_detections = detection_inference(args, center_frames)
  File "demo/demo_spatiotemporal_det.py", line 220, in detection_inference
    result = inference_detector(model, frame_path)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/apis/inference.py", line 147, in inference_detector
    results = model(return_loss=False, rescale=True, **data)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 95, in new_func
    return old_func(*args, **kwargs)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 173, in forward
    return self.forward_test(img, img_metas, **kwargs)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/models/detectors/base.py", line 146, in forward_test
    return self.simple_test(imgs[0], img_metas[0], **kwargs)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/models/detectors/two_stage.py", line 172, in simple_test
    proposal_list = self.rpn_head.simple_test_rpn(x, img_metas)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/models/dense_heads/rpn_test_mixin.py", line 36, in simple_test_rpn
    proposal_list = self.get_bboxes(*rpn_outs, img_metas)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 182, in new_func
    return old_func(*args, **kwargs)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/models/dense_heads/anchor_head.py", line 578, in get_bboxes
    result_list = self._get_bboxes(mlvl_cls_scores, mlvl_bbox_preds,
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmdet/models/dense_heads/rpn_head.py", line 185, in _get_bboxes
    cfg.nms)
  File "/home/boyu/github_projects/mmaction2/venv/lib/python3.8/site-packages/mmcv/utils/config.py", line 44, in __getattr__
    raise ex
AttributeError: 'ConfigDict' object has no attribute 'nms'

Bug fix

If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

@irvingzhang0512
Copy link
Contributor

irvingzhang0512 commented Jun 2, 2021

seems to be a mmdet issue, which version of mmdet do you use?

@wang-boyu
Copy link
Author

wang-boyu commented Jun 2, 2021

seems to be a mmdet issue, which version of mmdet do you use?

mmdet was installed via pip without specifying the version number. The version I got is 2.13.0.

edit: the error disappears when I downgrade mmdet to version 2.12.0.

@irvingzhang0512
Copy link
Contributor

@innerlee @dreamerlin @congee524
seems to be a BC issue. Since open-mmlab/mmdetection#5205 removes the deprecate arguments warning, mmdet v2.13.0 doesn't support current mmdet config. Maybe we should use latest config

BTW, if we use the latest mmdet config, mmdet has to be >= v2.10

@innerlee
Copy link
Contributor

innerlee commented Jun 2, 2021

yes det was quite aggressive in breaking things.

@dreamerlin
Copy link
Collaborator

@ZwwWayne, @jshilong

@dreamerlin
Copy link
Collaborator

This is a issue caused by MMDet BC breaking in nms, we will fix it soon. Thanks for your report

@dreamerlin dreamerlin linked a pull request Jun 3, 2021 that will close this issue
@irvingzhang0512
Copy link
Contributor

@dreamerlin @kennymckormick
For stdet demo, we had better add mmdet version requirements, mmdet >= v2.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants