mmrotate icon indicating copy to clipboard operation
mmrotate copied to clipboard

The value is the same before and after calling `init_weights` of R3Det [Bug]

Open fudemin1 opened this issue 1 year ago • 5 comments

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

master branch https://github.com/open-mmlab/mmrotate

Environment

sys.platform: linux Python: 3.8.16 (default, Mar 2 2023, 03:21:46) [GCC 11.2.0] CUDA available: True GPU 0: NVIDIA GeForce RTX 4090 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.3, V11.3.58 GCC: gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0 PyTorch: 1.11.0+cu113 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 v2.5.2 (Git Hash a9302535553c73243c632ad3c4c80beec3d19a1e)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 11.3
  • 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.2
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, 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 -DEDGE_PROFILER_USE_KINETO -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-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.11.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,

TorchVision: 0.12.0+cu113 OpenCV: 4.7.0 MMCV: 1.7.1 MMCV Compiler: GCC 7.5 MMCV CUDA Compiler: 11.3 MMRotate: 0.3.4+

Reproduces the problem - code sample


2023-06-06 14:59:10,516 - mmrotate - INFO - Distributed training: False 2023-06-06 14:59:10,807 - mmrotate - INFO - Config: dataset_type = 'DOTADataset' data_root = 'data/split_1024_dota1_0/' img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='RResize', img_scale=(1024, 1024)), dict( type='RRandomFlip', flip_ratio=[0.25, 0.25, 0.25], direction=['horizontal', 'vertical', 'diagonal'], version='oc'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) ] test_pipeline = [ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1024, 1024), flip=False, transforms=[ dict(type='RResize'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img']) ]) ] data = dict( samples_per_gpu=1, workers_per_gpu=1, train=dict( type='DOTADataset', ann_file='data/split_1024_dota1_0/trainval/annfiles/', img_prefix='data/split_1024_dota1_0/trainval/images/', pipeline=[ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='RResize', img_scale=(1024, 1024)), dict( type='RRandomFlip', flip_ratio=[0.25, 0.25, 0.25], direction=['horizontal', 'vertical', 'diagonal'], version='oc'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) ], version='oc'), val=dict( type='DOTADataset', ann_file='data/split_1024_dota1_0/trainval/annfiles/', img_prefix='data/split_1024_dota1_0/trainval/images/', pipeline=[ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1024, 1024), flip=False, transforms=[ dict(type='RResize'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img']) ]) ], version='oc'), test=dict( type='DOTADataset', ann_file='data/split_1024_dota1_0/test/images/', img_prefix='data/split_1024_dota1_0/test/images/', pipeline=[ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipAug', img_scale=(1024, 1024), flip=False, transforms=[ dict(type='RResize'), dict( type='Normalize', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img']) ]) ], version='oc')) evaluation = dict(interval=1, metric='mAP') optimizer = dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2)) lr_config = dict( policy='step', warmup='linear', warmup_iters=500, warmup_ratio=0.3333333333333333, step=[8, 11]) runner = dict(type='EpochBasedRunner', max_epochs=12) checkpoint_config = dict(interval=1) log_config = dict(interval=50, hooks=[dict(type='TextLoggerHook')]) dist_params = dict(backend='nccl') log_level = 'INFO' load_from = None resume_from = None workflow = [('train', 1)] opencv_num_threads = 0 mp_start_method = 'fork' angle_version = 'oc' model = dict( type='R3Det', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, zero_init_residual=False, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), neck=dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs='on_input', num_outs=5), bbox_head=dict( type='KFIoURRetinaHead', num_classes=1, in_channels=256, stacked_convs=4, feat_channels=256, anchor_generator=dict( type='RotatedAnchorGenerator', octave_base_scale=4, scales_per_octave=3, ratios=[1.0, 0.5, 2.0], strides=[8, 16, 32, 64, 128]), bbox_coder=dict( type='DeltaXYWHAOBBoxCoder', angle_range='oc', norm_factor=None, edge_swap=False, proj_xy=False, target_means=(0.0, 0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0, 1.0)), loss_cls=dict( type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0), loss_bbox=dict(type='KFLoss', fun='ln', loss_weight=5.0)), frm_cfgs=[dict(in_channels=256, featmap_strides=[8, 16, 32, 64, 128])], num_refine_stages=1, refine_heads=[ dict( type='KFIoURRetinaRefineHead', num_classes=1, in_channels=256, stacked_convs=4, feat_channels=256, assign_by_circumhbbox=None, anchor_generator=dict( type='PseudoAnchorGenerator', strides=[8, 16, 32, 64, 128]), bbox_coder=dict( type='DeltaXYWHAOBBoxCoder', angle_range='oc', norm_factor=None, edge_swap=False, proj_xy=False, target_means=(0.0, 0.0, 0.0, 0.0, 0.0), target_stds=(1.0, 1.0, 1.0, 1.0, 1.0)), loss_cls=dict( type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0), loss_bbox=dict(type='KFLoss', fun='ln', loss_weight=5.0)) ], train_cfg=dict( s0=dict( assigner=dict( type='MaxIoUAssigner', pos_iou_thr=0.5, neg_iou_thr=0.4, min_pos_iou=0, ignore_iof_thr=-1, iou_calculator=dict(type='RBboxOverlaps2D')), allowed_border=-1, pos_weight=-1, debug=False), sr=[ dict( assigner=dict( type='MaxIoUAssigner', pos_iou_thr=0.6, neg_iou_thr=0.5, min_pos_iou=0, ignore_iof_thr=-1, iou_calculator=dict(type='RBboxOverlaps2D')), allowed_border=-1, pos_weight=-1, debug=False) ], stage_loss_weights=[1.0]), test_cfg=dict( nms_pre=2000, min_bbox_size=0, score_thr=0.05, nms=dict(iou_thr=0.1), max_per_img=2000)) work_dir = '/home/fu/work/torch/mmrotate-main/work-dir' auto_resume = False gpu_ids = range(0, 1)

2023-06-06 14:59:10,807 - mmrotate - INFO - Set random seed to 1546496913, deterministic: False 2023-06-06 14:59:11,175 - mmcv - INFO - initialize ResNet with init_cfg {'type': 'Pretrained', 'checkpoint': 'torchvision://resnet50'} 2023-06-06 14:59:11,175 - mmcv - INFO - load model from: torchvision://resnet50 2023-06-06 14:59:11,175 - mmcv - INFO - load checkpoint from torchvision path: torchvision://resnet50 2023-06-06 14:59:11,249 - mmcv - WARNING - The model and loaded state dict do not match exactly

unexpected key in source state_dict: fc.weight, fc.bias

2023-06-06 14:59:11,264 - mmcv - INFO - initialize FPN with init_cfg {'type': 'Xavier', 'layer': 'Conv2d', 'distribution': 'uniform'} 2023-06-06 14:59:11,305 - mmcv - INFO - initialize KFIoURRetinaHead with init_cfg {'type': 'Normal', 'layer': 'Conv2d', 'std': 0.01, 'override': {'type': 'Normal', 'name': 'retina_cls', 'std': 0.01, 'bias_prob': 0.01}} 2023-06-06 14:59:11,340 - mmcv - INFO - initialize KFIoURRetinaRefineHead with init_cfg {'type': 'Normal', 'layer': 'Conv2d', 'std': 0.01, 'override': {'type': 'Normal', 'name': 'retina_cls', 'std': 0.01, 'bias_prob': 0.01}} 2023-06-06 14:59:11,369 - mmcv - INFO - backbone.conv1.weight - torch.Size([64, 3, 7, 7]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,369 - mmcv - INFO - backbone.bn1.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,369 - mmcv - INFO - backbone.bn1.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,369 - mmcv - INFO - backbone.layer1.0.conv1.weight - torch.Size([64, 64, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,369 - mmcv - INFO - backbone.layer1.0.bn1.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,369 - mmcv - INFO - backbone.layer1.0.bn1.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,369 - mmcv - INFO - backbone.layer1.0.conv2.weight - torch.Size([64, 64, 3, 3]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.bn2.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.bn2.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.conv3.weight - torch.Size([256, 64, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.bn3.weight - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.bn3.bias - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.downsample.0.weight - torch.Size([256, 64, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.downsample.1.weight - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.0.downsample.1.bias - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.conv1.weight - torch.Size([64, 256, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.bn1.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.bn1.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.conv2.weight - torch.Size([64, 64, 3, 3]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.bn2.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.bn2.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.conv3.weight - torch.Size([256, 64, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.bn3.weight - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.1.bn3.bias - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.conv1.weight - torch.Size([64, 256, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.bn1.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.bn1.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.conv2.weight - torch.Size([64, 64, 3, 3]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.bn2.weight - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.bn2.bias - torch.Size([64]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.conv3.weight - torch.Size([256, 64, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.bn3.weight - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer1.2.bn3.bias - torch.Size([256]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.conv1.weight - torch.Size([128, 256, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.bn1.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.bn1.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.conv2.weight - torch.Size([128, 128, 3, 3]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.bn2.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.bn2.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.conv3.weight - torch.Size([512, 128, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.bn3.weight - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.bn3.bias - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.downsample.0.weight - torch.Size([512, 256, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.downsample.1.weight - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.0.downsample.1.bias - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,370 - mmcv - INFO - backbone.layer2.1.conv1.weight - torch.Size([128, 512, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.bn1.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.bn1.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.conv2.weight - torch.Size([128, 128, 3, 3]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.bn2.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.bn2.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.conv3.weight - torch.Size([512, 128, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.bn3.weight - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.1.bn3.bias - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.conv1.weight - torch.Size([128, 512, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.bn1.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.bn1.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.conv2.weight - torch.Size([128, 128, 3, 3]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.bn2.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.bn2.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.conv3.weight - torch.Size([512, 128, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.bn3.weight - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.2.bn3.bias - torch.Size([512]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.3.conv1.weight - torch.Size([128, 512, 1, 1]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.3.bn1.weight - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.3.bn1.bias - torch.Size([128]): PretrainedInit: load from torchvision://resnet50

2023-06-06 14:59:11,371 - mmcv - INFO - backbone.layer2.3.conv2.weight - torch.Size([128, 128, 3, 3]): PretrainedInit: load from torchvision://resnet50 2023-06-06 14:59:11,374 - mmcv - INFO - neck.fpn_convs.3.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 14:59:11,374 - mmcv - INFO - neck.fpn_convs.4.conv.weight - torch.Size([256, 256, 3, 3]): XavierInit: gain=1, distribution=uniform, bias=0

2023-06-06 14:59:11,374 - mmcv - INFO - neck.fpn_convs.4.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.0.conv.weight - torch.Size([256, 256, 3, 3]): NormalInit: mean=0, std=0.01, bias=0

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.0.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.1.conv.weight - torch.Size([256, 256, 3, 3]): NormalInit: mean=0, std=0.01, bias=0

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.1.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.2.conv.weight - torch.Size([256, 256, 3, 3]): NormalInit: mean=0, std=0.01, bias=0

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.2.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.3.conv.weight - torch.Size([256, 256, 3, 3]): NormalInit: mean=0, std=0.01, bias=0

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.cls_convs.3.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.reg_convs.0.conv.weight - torch.Size([256, 256, 3, 3]): NormalInit: mean=0, std=0.01, bias=0

2023-06-06 14:59:11,374 - mmcv - INFO - bbox_head.reg_convs.0.conv.bias - torch.Size([256]): The value is the same before and after calling init_weights of R3Det

2023-06-06 15:00:09,816 - mmrotate - INFO - +-------+-----+------+--------+-------+ | class | gts | dets | recall | ap | +-------+-----+------+--------+-------+ | ship | 9 | 0 | 0.000 | 0.000 | +-------+-----+------+--------+-------+ | mAP | | | | 0.000 | +-------+-----+------+--------+-------+

Reproduces the problem - command or script

parser = argparse.ArgumentParser(description='Train a detector') parser.add_argument('--config',default='/home/fu/work/torch/mmrotate-main/config/r3det_kfiou_ln_r50_fpn_1x_dota_oc.py', help='train config file path') parser.add_argument('--work-dir', default='/home/fu/work/torch/mmrotate-main/work-dir',help='the dir to save logs and models')

Reproduces the problem - error message

The value is the same before and after calling init_weights of R3Det

2023-06-06 15:00:09,816 - mmrotate - INFO - +-------+-----+------+--------+-------+ | class | gts | dets | recall | ap | +-------+-----+------+--------+-------+ | ship | 9 | 0 | 0.000 | 0.000 | +-------+-----+------+--------+-------+ | mAP | | | | 0.000 | +-------+-----+------+--------+-------+

Additional information

试了好多模型,都是出现The value is the same before and after calling init_weights ,且训练多周期ap为0

fudemin1 avatar Jun 06 '23 07:06 fudemin1

Hi, @fudemin1. In fact, the warning The value is the same before and after calling init_weights will not affect the model's performance. Ap equals 0 may be due to the lack of training data leading to the inability of the model to converge. KFIOU is especially very unstable.

zytx121 avatar Jun 08 '23 08:06 zytx121

unexpected key in source state_dict: backbone.conv1.weights, backbone.conv1.basisexpansion.block_expansion('irrep_0', 'regular').sampled_basis, missing keys in source state_dict: conv1.weights, conv1.filter, conv1.basisexpansion.block_expansion('irrep_0', 'regular').sampled_basis, 加载预训练模型时,模型的key总是比网络的key 多backkbone,导致加载模型失败,该怎么解决呢 @zytx121

fudemin1 avatar Jun 08 '23 08:06 fudemin1

解决了吗

YLONl avatar Jul 04 '23 12:07 YLONl

好难啊。。

Yanhui-Struggle avatar Sep 21 '23 01:09 Yanhui-Struggle

请问解决了吗

2252033991 avatar Oct 12 '23 13:10 2252033991