open-mmlab / mmtracking

OpenMMLab Video Perception Toolbox. It supports Video Object Detection (VID), Multiple Object Tracking (MOT), Single Object Tracking (SOT), Video Instance Segmentation (VIS) with a unified framework.
https://mmtracking.readthedocs.io/en/latest/
Apache License 2.0
3.56k stars 598 forks source link

'NoneType' object has no attribute 'copy' #166

Closed zpyi closed 3 years ago

zpyi commented 3 years ago

Thanks for your error report and we appreciate it a lot.

Describe the bug When I run SELSA , it reports AttributeError:'NoneType' object has no attribute 'copy'

  1. What command or script did you run? python ./tools/train.py configs/vid/selsa/selsa_faster_rcnn_r50_dc5_1x_imagenetvid.py

  2. Did you make any modifications on the code or config? Did you understand what you have modified?

I modified '/mmdet/models/dense_heads/rpn_head.py', line185, from 'cfg.nms' to 'cfg.get('nms')'

  1. What dataset did you use and what task did you run? I used ILSVRC dataset and run video object detection task. Environment Python: 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 16:07:37) [GCC 9.3.0] CUDA available: True GPU 0,1,2,3,4,5,6,7: GeForce RTX 3090 CUDA_HOME: /usr/local/cuda NVCC: Build cuda_11.1.TC455_06.29069683_0 GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 PyTorch: 1.7.1 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 v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
    • OpenMP 201511 (a.k.a. OpenMP 4.5)
    • NNPACK is enabled
    • CPU capability usage: AVX2
    • CUDA Runtime 11.0
    • 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_80,code=sm_80;-gencode;arch=compute_37,code=compute_37
    • CuDNN 8.0.5
    • Magma 2.5.2
    • Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=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.8.2 OpenCV: 4.5.2 MMCV: 1.3.5 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 11.0 MMTracking: 0.5.0+22cf5ee

Error traceback

2021-05-29 17:39:53,278 - mmtrack - INFO - workflow: [('train', 1)], max: 7 epochs Traceback (most recent call last): File "./tools/train.py", line 168, in main() File "./tools/train.py", line 164, in main meta=meta) File "/mmdetection/mmtracking/mmtrack/apis/train.py", line 135, in train_model runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run epoch_runner(data_loaders[i], kwargs) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train self.run_iter(data_batch, train_mode=True, kwargs) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 30, in run_iter kwargs) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 67, in train_step return self.module.train_step(inputs[0], kwargs[0]) File "/mmdetection/mmtracking/mmtrack/models/vid/base.py", line 215, in train_step losses = self(data) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 95, in new_func return old_func(args, kwargs) File "/mmdetection/mmtracking/mmtrack/models/vid/base.py", line 149, in forward return self.forward_train(img, img_metas, kwargs) File "/mmdetection/mmtracking/mmtrack/models/vid/selsa.py", line 156, in forward_train proposal_cfg=proposal_cfg) File "/mmdetection/mmdet/models/dense_heads/base_dense_head.py", line 58, in forward_train proposal_list = self.get_bboxes(outs, img_metas, cfg=proposal_cfg) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 182, in new_func return old_func(*args, **kwargs) File "/mmdetection/mmdet/models/dense_heads/anchor_head.py", line 580, in get_bboxes scale_factors, cfg, rescale) File "/mmdetection/mmdet/models/dense_heads/rpn_head.py", line 185, in _get_bboxes cfg.get('nms')) File "/miniconda3/envs/mmtrack/lib/python3.7/site-packages/mmcv/ops/nms.py", line 264, in batched_nms nmscfg = nms_cfg.copy() AttributeError: 'NoneType' object has no attribute 'copy'

GT9505 commented 3 years ago

fix in #167