mmagic
mmagic copied to clipboard
KeyError: "BasicVSR: 'BasicVSRPlusPlus is not in the model registry'"
Hi,
I am training BasicVSR++ from scratch on HPC cluster with following environment info:
`> sys.platform: linux Python: 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0] CUDA available: True GPU 0: Tesla T4 CUDA_HOME: /usr/local/cuda NVCC: Build cuda_11.0_bu.TC445_37.28845127_0 GCC: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) PyTorch: 1.9.0 PyTorch compiling details: PyTorch built with:
- GCC 7.3
- C++ Version: 201402
- Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 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.4 MMCV: 1.4.6 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 10.2 MMEditing: 0.13.0+793d026 `
After stopping the training due to time limit in cluster, I resume the training using config file basicvsr_plusplus_c64n7_8x1_600k_reds4.py :
--resume-from .../results/BasicVSR_plus_plus/train/iter_565000.pth
However I got the following error:
KeyError: "BasicVSR: 'BasicVSRPlusPlus is not in the model registry'"
This is while I resumed the training two times ago and it worked without problem.
The complete error message: `Traceback (most recent call last): File "/kuacc/users/nrahimi19/miniconda3/envs/mmlab/lib/python3.8/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(**args) File "/scratch/users/nrahimi19/mmediting/mmedit/models/restorers/basicvsr.py", line 40, in init super().init(generator, pixel_loss, train_cfg, test_cfg, File "/scratch/users/nrahimi19/mmediting/mmedit/models/restorers/basic_restorer.py", line 48, in init self.generator = build_backbone(generator) File "/scratch/users/nrahimi19/mmediting/mmedit/models/builder.py", line 31, in build_backbone return build(cfg, BACKBONES) File "/scratch/users/nrahimi19/mmediting/mmedit/models/builder.py", line 22, in build return build_from_cfg(cfg, registry, default_args) File "/kuacc/users/nrahimi19/miniconda3/envs/mmlab/lib/python3.8/site-packages/mmcv/utils/registry.py", line 44, in build_from_cfg raise KeyError( KeyError: 'BasicVSRPlusPlus is not in the model registry'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/scratch/users/nrahimi19/mmediting/tools/train.py", line 150, in
Could you please help?
BasicVSR++ should not be in the model registry. It should be in the backbone registry.
Thanks for your response @ckkelvinchan
How can I fix it? Using config file?
I did change nothing in config file but --resume-from .../results/BasicVSR_plus_plus/train/iter_565000.pth
. What may cause this error?
This is a bit strange. How about trying to use the resume_from
in the configuration file?
Dear @ckkelvinchan
I found out that I have removed @BACKBONES.register_module() in basicvsr_pp.py file by mistake, I fix it and it works without problem. Thank you