Closed Acuhe closed 1 year ago
As the model in detection is kind of different from the model in self-supervised learning, we load the model separately, thus it prints the warning message showing that it is not match. But it is not an error.
For your error, you could set a breakpoint to check the data_itement before raising the error. Besides, you could also create an issue in mmdet for more detailed help, we will also check it ASAP
Sorry to bother you but I don't know how to "set a breakpoint to check the data_itement before raising the error" in the config file. I'd like to print the size of the input data in dataloader, but I have no idea about which variable the batch information or the loaded data is actually stored in ... I would really appreciate it if you could give me some brief guidance! @fangyixiao18
Branch
1.x branch (1.x version, such as
v1.0.0rc2
, ordev-1.x
branch)Prerequisite
Environment
System environment: sys.platform: linux Python: 3.9.16 (main, Dec 7 2022, 01:11:51) [GCC 9.4.0] CUDA available: True numpy_random_seed: 1816210116 GPU 0: Tesla T4 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.8, V11.8.89 GCC: x86_64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 PyTorch: 1.13.1+cu116 PyTorch compiling details: PyTorch built with:
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.6, CUDNN_VERSION=8.3.2, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -fabi-version=11 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -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 -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.13.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, USE_ROCM=OFF,
TorchVision: 0.14.1+cu116 OpenCV: 4.7.0 MMEngine: 0.7.0
Runtime environment: cudnn_benchmark: False mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0} dist_cfg: {'backend': 'nccl'} seed: None Distributed launcher: pytorch Distributed training: True GPU number: 1
Describe the bug
The model and loaded state dict do not match exactly RuntimeError: Caught RuntimeError in DataLoader worker process 0. RuntimeError: each data_itement in list of batch should be of equal size
I followed the instruction of evaluating the pre-trained model loaded from model zoo on VOC detection tasks. I can't figure out the source of "Runtime error". I wonder if you could tell me how to check the size of "data_itement". In addtion, the loaded DenseCL model does not match the detection model.
Reproduces the problem - code sample
%%writefile /content/mmselfsup/configs/benchmarks/mmdetection/voc0712/faster_rcnn_r50_c4_ms-3k_voc0712_test.py base = 'faster-rcnn_r50-c4_ms-24k_voc0712.py'
optim_wrapper = dict(
type='OptimWrapper',
optimizer=dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001))
optim_wrapper = dict(optimizer=dict(lr=0.02 * (1 / 8)))
data_root = 'data/VOCdevkit/' train_dataloader = dict( sampler=dict(type='InfiniteSampler', shuffle=True), dataset=dict( delete=True, type='ConcatDataset', ignore_keys=['dataset_type'], datasets=[ dict( type='VOCDataset', data_root=data_root, ann_file='VOC2007/ImageSets/Main/trainval.txt', data_prefix=dict(sub_data_root='VOC2007/'), filter_cfg=dict(filter_empty_gt=True, min_size=32), ), dict( type='VOCDataset', data_root=data_root, ann_file='VOC2012/ImageSets/Main/trainval.txt', data_prefix=dict(sub_data_root='VOC2012/'), filter_cfg=dict(filter_empty_gt=True, min_size=32), ) ]))
custom_imports = dict( imports=['mmselfsup.models.utils.res_layer_extra_norm_mine'], # modified extranorm allow_failed_imports=False)
!bash tools/benchmarks/mmdetection/mim_dist_train_c4.sh \ configs/benchmarks/mmdetection/voc0712/faster_rcnn_r50_c4_ms-3k_voc0712_test.py \ /content/mmselfsup/checkpoints/densecl_resnet50_8xb32-coslr-200e_in1k_20220825-3078723b.pth \ 1
Reproduces the problem - command or script
No response
Reproduces the problem - error message
Additional information
No response