【MMDetection】bug记录

【MMDetection】bug记录_第1张图片


bug1:

if env_cfg.get('cudnn_benchmark'): AttributeError: 'NoneType' object has no attribute 'get'

解决办法:

配置文件缺少了env_cfg信息,需要在config文件中添加,如以下内容:

env_cfg = dict(
    cudnn_benchmark=False,
    mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
    dist_cfg=dict(backend='nccl'))


 bug2

KeyError: 'DetLocalVisualizer is not in the visualizer registry. Please check whether the value of `DetLocalVisualizer` is correct or it was registered as expected.

解决办法:

mmcv版本问题

https://github.com/open-mmlab/mmdetection/issues/9914

修改之前的版本信息:

sys.platform: win32
Python: 3.8.16 (default, Jun 12 2023, 21:00:42) [MSC v.1916 64 bit (AMD64)]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 3060 Ti
CUDA_HOME: None
MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.36.32535 版
GCC: n/a
PyTorch: 1.8.0
PyTorch compiling details: PyTorch built with:
  - C++ Version: 199711
  - MSVC 192829337
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191125 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.7.0 (Git Hash 7aed236906b1f7a05c0917e5257a1af05e9ff683)
  - OpenMP 2019
  - 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_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_86,code=sm_86;-gencode;arch=compute_37,code=compute_37
  - CuDNN 8.0.5
  - Magma 2.5.4
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, 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 -DNDEBUG -DUSE_FBGEMM -DUSE_XNNPACK, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.8.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=OFF, USE_NNPACK=OFF, USE_OPENMP=ON,

TorchVision: 0.9.0
OpenCV: 4.8.0
MMEngine: 0.8.0
mmdetection: 3.1.0+f78af77

以上所有问题 也有可能源自于继承文件没继承上,可以打印出继承前的配置文件与继承后的配置文件做对比:

以下命令可以打印出配置文件所有信息,如打印configs\yolox\yolox_s_8xb8-300e_coco.py

python tools\misc\print_config.py configs\yolox\yolox_s_8xb8-300e_coco.py

最简单不易报错的使用方式:可以保存完整的配置文件,然后在完整的配置文件中直接修改

python tools\misc\print_config.py  configs\yolox\yolox_s_8xb8-300e_coco.py --save-path complete_yolox_s_8xb8-300e_coco.py 

你可能感兴趣的:(OpenMMLab实战训练营,bug)