PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.29k stars 7.83k forks source link

> 你用的代码分支是? #7029

Closed Akumio closed 2 years ago

Akumio commented 2 years ago

你用的代码分支是?

paddleOcr 2.3 里面加载 pretrained model 用的下面的函数 这个是根据shape匹配权重的

def load_dygraph_params(config, model, logger, optimizer):
    ckp = config['Global']['checkpoints']
    if ckp and os.path.exists(ckp + ".pdparams"):
        pre_best_model_dict = init_model(config, model, optimizer)
        return pre_best_model_dict
    else:
        pm = config['Global']['pretrained_model']
        if pm is None:
            return {}
        if not os.path.exists(pm) and not os.path.exists(pm + ".pdparams"):
            logger.info(f"The pretrained_model {pm} does not exists!")
            return {}
        pm = pm if pm.endswith('.pdparams') else pm + '.pdparams'
        params = paddle.load(pm)
        state_dict = model.state_dict()
        new_state_dict = {}
        for k1, k2 in zip(state_dict.keys(), params.keys()):
            if list(state_dict[k1].shape) == list(params[k2].shape):
                new_state_dict[k1] = params[k2]
            else:
                logger.info(
                    f"The shape of model params {k1} {state_dict[k1].shape} not matched with loaded params {k2} {params[k2].shape} !"
                )
        model.set_state_dict(new_state_dict)
        logger.info(f"loaded pretrained_model successful from {pm}")
        return {}

paddleOcr 2.5 里面加载 pretrained model 用的下面的函数 这个是根据 key 的 key name 匹配权重的

def load_pretrained_params(model, path):
    logger = get_logger()
    if path.endswith('.pdparams'):
        path = path.replace('.pdparams', '')
    assert os.path.exists(path + ".pdparams"), \
        "The {}.pdparams does not exists!".format(path)

    params = paddle.load(path + '.pdparams')
    state_dict = model.state_dict()
    new_state_dict = {}
    for k1 in params.keys():
        if k1 not in state_dict.keys():
            logger.warning("The pretrained params {} not in model".format(k1))
        else:
            if list(state_dict[k1].shape) == list(params[k1].shape):
                new_state_dict[k1] = params[k1]
            else:
                logger.warning(
                    "The shape of model params {} {} not matched with loaded params {} {} !".
                    format(k1, state_dict[k1].shape, k1, params[k1].shape))
    model.set_state_dict(new_state_dict)
    logger.info("load pretrain successful from {}".format(path))
    return model

上面的问题就是由于这个改动造成的。

另外在使用 ch_PP-OCRv3_det_cml.yml 进行cml 蒸馏时,student 模型加载预训练模型,原始的日志是作者上面发的那些,改用2.3的 load_dygraph_params 加载 预训练模型,输出的日志是下面的这些,new_state_dict 大约匹配84个key。 这里 student 模型 是否加载预训练模型 区别大吗?

[2022/07/17 14:08:07] ppocr INFO: Architecture : 
[2022/07/17 14:08:07] ppocr INFO:     Models : 
[2022/07/17 14:08:07] ppocr INFO:         Student : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 disable_se : True
[2022/07/17 14:08:07] ppocr INFO:                 model_name : large
[2022/07/17 14:08:07] ppocr INFO:                 name : MobileNetV3
[2022/07/17 14:08:07] ppocr INFO:                 scale : 0.5
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : RSEFPN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 96
[2022/07/17 14:08:07] ppocr INFO:                 shortcut : True
[2022/07/17 14:08:07] ppocr INFO:             Transform : None
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/pretrained/MobileNetV3_large_x0_5_pretrained
[2022/07/17 14:08:07] ppocr INFO:         Student2 : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 disable_se : True
[2022/07/17 14:08:07] ppocr INFO:                 model_name : large
[2022/07/17 14:08:07] ppocr INFO:                 name : MobileNetV3
[2022/07/17 14:08:07] ppocr INFO:                 scale : 0.5
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : RSEFPN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 96
[2022/07/17 14:08:07] ppocr INFO:                 shortcut : True
[2022/07/17 14:08:07] ppocr INFO:             Transform : None
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/pretrained/MobileNetV3_large_x0_5_pretrained
[2022/07/17 14:08:07] ppocr INFO:         Teacher : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 in_channels : 3
[2022/07/17 14:08:07] ppocr INFO:                 layers : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : ResNet
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 kernel_list : [7, 2, 2]
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : LKPAN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 224
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             freeze_params : True
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/db_0629_v1/student
[2022/07/17 14:08:07] ppocr INFO:             return_all_feats : False
[2022/07/17 14:08:07] ppocr INFO:     algorithm : Distillation
[2022/07/17 14:08:07] ppocr INFO:     model_type : det
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationModel
[2022/07/17 14:08:07] ppocr INFO: Eval : 
[2022/07/17 14:08:07] ppocr INFO:     dataset : 
[2022/07/17 14:08:07] ppocr INFO:         data_dir : None
[2022/07/17 14:08:07] ppocr INFO:         label_file_list : ['custom/data/det_word_0421_val.txt']
[2022/07/17 14:08:07] ppocr INFO:         name : SimpleDataSet
[2022/07/17 14:08:07] ppocr INFO:         transforms : 
[2022/07/17 14:08:07] ppocr INFO:             DecodeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 channel_first : False
[2022/07/17 14:08:07] ppocr INFO:                 img_mode : BGR
[2022/07/17 14:08:07] ppocr INFO:             DetLabelEncode : None
[2022/07/17 14:08:07] ppocr INFO:             DetResizeForTest : None
[2022/07/17 14:08:07] ppocr INFO:             NormalizeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 mean : [0.485, 0.456, 0.406]
[2022/07/17 14:08:07] ppocr INFO:                 order : hwc
[2022/07/17 14:08:07] ppocr INFO:                 scale : 1./255.
[2022/07/17 14:08:07] ppocr INFO:                 std : [0.229, 0.224, 0.225]
[2022/07/17 14:08:07] ppocr INFO:             ToCHWImage : None
[2022/07/17 14:08:07] ppocr INFO:             KeepKeys : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_keys : ['image', 'shape', 'polys', 'ignore_tags']
[2022/07/17 14:08:07] ppocr INFO:     loader : 
[2022/07/17 14:08:07] ppocr INFO:         batch_size_per_card : 1
[2022/07/17 14:08:07] ppocr INFO:         drop_last : False
[2022/07/17 14:08:07] ppocr INFO:         num_workers : 1
[2022/07/17 14:08:07] ppocr INFO:         shuffle : False
[2022/07/17 14:08:07] ppocr INFO:         use_shared_memory : False
[2022/07/17 14:08:07] ppocr INFO: Global : 
[2022/07/17 14:08:07] ppocr INFO:     cal_metric_during_train : False
[2022/07/17 14:08:07] ppocr INFO:     checkpoints : None
[2022/07/17 14:08:07] ppocr INFO:     debug : False
[2022/07/17 14:08:07] ppocr INFO:     distributed : False
[2022/07/17 14:08:07] ppocr INFO:     epoch_num : 500
[2022/07/17 14:08:07] ppocr INFO:     eval_batch_step : [0, 400]
[2022/07/17 14:08:07] ppocr INFO:     infer_img : doc/imgs_en/img_10.jpg
[2022/07/17 14:08:07] ppocr INFO:     log_smooth_window : 20
[2022/07/17 14:08:07] ppocr INFO:     pretrained_model : None
[2022/07/17 14:08:07] ppocr INFO:     print_batch_step : 10
[2022/07/17 14:08:07] ppocr INFO:     save_epoch_step : 100
[2022/07/17 14:08:07] ppocr INFO:     save_inference_dir : None
[2022/07/17 14:08:07] ppocr INFO:     save_model_dir : ./models/det/db_test/
[2022/07/17 14:08:07] ppocr INFO:     save_res_path : ./checkpoints/det_db/predicts_db.txt
[2022/07/17 14:08:07] ppocr INFO:     use_gpu : False
[2022/07/17 14:08:07] ppocr INFO:     use_visualdl : False
[2022/07/17 14:08:07] ppocr INFO: Loss : 
[2022/07/17 14:08:07] ppocr INFO:     loss_config_list : 
[2022/07/17 14:08:07] ppocr INFO:         DistillationDilaDBLoss : 
[2022/07/17 14:08:07] ppocr INFO:             alpha : 5
[2022/07/17 14:08:07] ppocr INFO:             balance_loss : True
[2022/07/17 14:08:07] ppocr INFO:             beta : 10
[2022/07/17 14:08:07] ppocr INFO:             key : maps
[2022/07/17 14:08:07] ppocr INFO:             main_loss_type : DiceLoss
[2022/07/17 14:08:07] ppocr INFO:             model_name_pairs : [['Student', 'Teacher'], ['Student2', 'Teacher']]
[2022/07/17 14:08:07] ppocr INFO:             ohem_ratio : 3
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:         DistillationDMLLoss : 
[2022/07/17 14:08:07] ppocr INFO:             key : maps
[2022/07/17 14:08:07] ppocr INFO:             maps_name : thrink_maps
[2022/07/17 14:08:07] ppocr INFO:             model_name_pairs : ['Student', 'Student2']
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:         DistillationDBLoss : 
[2022/07/17 14:08:07] ppocr INFO:             alpha : 5
[2022/07/17 14:08:07] ppocr INFO:             balance_loss : True
[2022/07/17 14:08:07] ppocr INFO:             beta : 10
[2022/07/17 14:08:07] ppocr INFO:             main_loss_type : DiceLoss
[2022/07/17 14:08:07] ppocr INFO:             model_name_list : ['Student', 'Student2']
[2022/07/17 14:08:07] ppocr INFO:             ohem_ratio : 3
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:     name : CombinedLoss
[2022/07/17 14:08:07] ppocr INFO: Metric : 
[2022/07/17 14:08:07] ppocr INFO:     base_metric_name : DetMetric
[2022/07/17 14:08:07] ppocr INFO:     key : Student
[2022/07/17 14:08:07] ppocr INFO:     main_indicator : hmean
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationMetric
[2022/07/17 14:08:07] ppocr INFO: Optimizer : 
[2022/07/17 14:08:07] ppocr INFO:     beta1 : 0.9
[2022/07/17 14:08:07] ppocr INFO:     beta2 : 0.999
[2022/07/17 14:08:07] ppocr INFO:     lr : 
[2022/07/17 14:08:07] ppocr INFO:         learning_rate : 0.001
[2022/07/17 14:08:07] ppocr INFO:         name : Cosine
[2022/07/17 14:08:07] ppocr INFO:         warmup_epoch : 2
[2022/07/17 14:08:07] ppocr INFO:     name : Adam
[2022/07/17 14:08:07] ppocr INFO:     regularizer : 
[2022/07/17 14:08:07] ppocr INFO:         factor : 5e-05
[2022/07/17 14:08:07] ppocr INFO:         name : L2
[2022/07/17 14:08:07] ppocr INFO: PostProcess : 
[2022/07/17 14:08:07] ppocr INFO:     box_thresh : 0.6
[2022/07/17 14:08:07] ppocr INFO:     key : head_out
[2022/07/17 14:08:07] ppocr INFO:     max_candidates : 1000
[2022/07/17 14:08:07] ppocr INFO:     model_name : ['Student']
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationDBPostProcess
[2022/07/17 14:08:07] ppocr INFO:     thresh : 0.3
[2022/07/17 14:08:07] ppocr INFO:     unclip_ratio : 1.5
[2022/07/17 14:08:07] ppocr INFO: Train : 
[2022/07/17 14:08:07] ppocr INFO:     dataset : 
[2022/07/17 14:08:07] ppocr INFO:         data_dir : None
[2022/07/17 14:08:07] ppocr INFO:         label_file_list : ['custom/data/det_word_0421_train.txt']
[2022/07/17 14:08:07] ppocr INFO:         name : SimpleDataSet
[2022/07/17 14:08:07] ppocr INFO:         ratio_list : [1.0]
[2022/07/17 14:08:07] ppocr INFO:         transforms : 
[2022/07/17 14:08:07] ppocr INFO:             DecodeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 channel_first : False
[2022/07/17 14:08:07] ppocr INFO:                 img_mode : BGR
[2022/07/17 14:08:07] ppocr INFO:             DetLabelEncode : None
[2022/07/17 14:08:07] ppocr INFO:             CopyPaste : None
[2022/07/17 14:08:07] ppocr INFO:             IaaAugment : 
[2022/07/17 14:08:07] ppocr INFO:                 augmenter_args : 
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         p : 0.5
[2022/07/17 14:08:07] ppocr INFO:                     type : Fliplr
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         rotate : [-10, 10]
[2022/07/17 14:08:07] ppocr INFO:                     type : Affine
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         size : [0.5, 3]
[2022/07/17 14:08:07] ppocr INFO:                     type : Resize
[2022/07/17 14:08:07] ppocr INFO:             EastRandomCropData : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_ratio : True
[2022/07/17 14:08:07] ppocr INFO:                 max_tries : 50
[2022/07/17 14:08:07] ppocr INFO:                 size : [640, 640]
[2022/07/17 14:08:07] ppocr INFO:             MakeBorderMap : 
[2022/07/17 14:08:07] ppocr INFO:                 shrink_ratio : 0.4
[2022/07/17 14:08:07] ppocr INFO:                 thresh_max : 0.7
[2022/07/17 14:08:07] ppocr INFO:                 thresh_min : 0.3
[2022/07/17 14:08:07] ppocr INFO:             MakeShrinkMap : 
[2022/07/17 14:08:07] ppocr INFO:                 min_text_size : 8
[2022/07/17 14:08:07] ppocr INFO:                 shrink_ratio : 0.4
[2022/07/17 14:08:07] ppocr INFO:             NormalizeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 mean : [0.485, 0.456, 0.406]
[2022/07/17 14:08:07] ppocr INFO:                 order : hwc
[2022/07/17 14:08:07] ppocr INFO:                 scale : 1./255.
[2022/07/17 14:08:07] ppocr INFO:                 std : [0.229, 0.224, 0.225]
[2022/07/17 14:08:07] ppocr INFO:             ToCHWImage : None
[2022/07/17 14:08:07] ppocr INFO:             KeepKeys : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_keys : ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask']
[2022/07/17 14:08:07] ppocr INFO:     loader : 
[2022/07/17 14:08:07] ppocr INFO:         batch_size_per_card : 4
[2022/07/17 14:08:07] ppocr INFO:         drop_last : False
[2022/07/17 14:08:07] ppocr INFO:         num_workers : 1
[2022/07/17 14:08:07] ppocr INFO:         shuffle : True
[2022/07/17 14:08:07] ppocr INFO:         use_shared_memory : False
[2022/07/17 14:08:07] ppocr INFO: profiler_options : None
[2022/07/17 14:08:07] ppocr INFO: train with paddle 2.1.2 and device CPUPlace
[2022/07/17 14:08:14] ppocr INFO: Initialize indexs of datasets:['custom/data/det_word_0421_train.txt']
[2022/07/17 14:08:14] ppocr INFO: Initialize indexs of datasets:['custom/data/det_word_0421_val.txt']
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.conv.weight [24, 40, 1, 1] not matched with loaded params conv5.mid_se.conv1.weight [10, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn.weight [24] not matched with loaded params conv5.mid_se.conv1.bias [10] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn.bias [24] not matched with loaded params conv5.mid_se.conv2.weight [40, 10, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn._mean [24] not matched with loaded params conv5.mid_se.conv2.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn._variance [24] not matched with loaded params conv5.linear_conv.conv.weight [24, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.conv.weight [64, 24, 1, 1] not matched with loaded params conv5.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn.weight [64] not matched with loaded params conv5.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn.bias [64] not matched with loaded params conv5.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn._mean [64] not matched with loaded params conv5.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn._variance [64] not matched with loaded params conv6.expand_conv.conv.weight [64, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.bottleneck_conv.conv.weight [64, 1, 5, 5] not matched with loaded params conv6.expand_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.bottleneck_conv.bn._variance [64] not matched with loaded params conv6.bottleneck_conv.conv.weight [64, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.conv.weight [24, 64, 1, 1] not matched with loaded params conv6.bottleneck_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn.weight [24] not matched with loaded params conv6.bottleneck_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn.bias [24] not matched with loaded params conv6.bottleneck_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn._mean [24] not matched with loaded params conv6.bottleneck_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn._variance [24] not matched with loaded params conv6.mid_se.conv1.weight [16, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.conv.weight [64, 24, 1, 1] not matched with loaded params conv6.mid_se.conv1.bias [16] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn.weight [64] not matched with loaded params conv6.mid_se.conv2.weight [64, 16, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn._mean [64] not matched with loaded params conv6.linear_conv.conv.weight [24, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn._variance [64] not matched with loaded params conv6.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.conv.weight [64, 1, 5, 5] not matched with loaded params conv6.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn.weight [64] not matched with loaded params conv6.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn.bias [64] not matched with loaded params conv6.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn._mean [64] not matched with loaded params conv7.expand_conv.conv.weight [64, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.conv.weight [24, 64, 1, 1] not matched with loaded params conv7.expand_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn.weight [24] not matched with loaded params conv7.expand_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn.bias [24] not matched with loaded params conv7.expand_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn._mean [24] not matched with loaded params conv7.bottleneck_conv.conv.weight [64, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn._variance [24] not matched with loaded params conv7.bottleneck_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.conv.weight [120, 24, 1, 1] not matched with loaded params conv7.bottleneck_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn.weight [120] not matched with loaded params conv7.bottleneck_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn.bias [120] not matched with loaded params conv7.bottleneck_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn._mean [120] not matched with loaded params conv7.mid_se.conv1.weight [16, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn._variance [120] not matched with loaded params conv7.mid_se.conv1.bias [16] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.conv.weight [120, 1, 3, 3] not matched with loaded params conv7.mid_se.conv2.weight [64, 16, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn.weight [120] not matched with loaded params conv7.mid_se.conv2.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn.bias [120] not matched with loaded params conv7.linear_conv.conv.weight [24, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn._mean [120] not matched with loaded params conv7.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn._variance [120] not matched with loaded params conv7.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.conv.weight [40, 120, 1, 1] not matched with loaded params conv7.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn.weight [40] not matched with loaded params conv7.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn.bias [40] not matched with loaded params conv8.expand_conv.conv.weight [120, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn._mean [40] not matched with loaded params conv8.expand_conv.bn.weight [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn._variance [40] not matched with loaded params conv8.expand_conv.bn.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.conv.weight [104, 40, 1, 1] not matched with loaded params conv8.expand_conv.bn._mean [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn.weight [104] not matched with loaded params conv8.expand_conv.bn._variance [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn.bias [104] not matched with loaded params conv8.bottleneck_conv.conv.weight [120, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn._mean [104] not matched with loaded params conv8.bottleneck_conv.bn.weight [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn._variance [104] not matched with loaded params conv8.bottleneck_conv.bn.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.conv.weight [104, 1, 3, 3] not matched with loaded params conv8.bottleneck_conv.bn._mean [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn.weight [104] not matched with loaded params conv8.bottleneck_conv.bn._variance [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn.bias [104] not matched with loaded params conv8.linear_conv.conv.weight [40, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn._mean [104] not matched with loaded params conv8.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn._variance [104] not matched with loaded params conv8.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.conv.weight [40, 104, 1, 1] not matched with loaded params conv8.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn.bias [40] not matched with loaded params conv9.expand_conv.conv.weight [104, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn._mean [40] not matched with loaded params conv9.expand_conv.bn.weight [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn._variance [40] not matched with loaded params conv9.expand_conv.bn.bias [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.conv.weight [96, 40, 1, 1] not matched with loaded params conv9.expand_conv.bn._mean [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn.weight [96] not matched with loaded params conv9.expand_conv.bn._variance [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn.bias [96] not matched with loaded params conv9.bottleneck_conv.conv.weight [104, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn._mean [96] not matched with loaded params conv9.bottleneck_conv.bn.weight [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn._variance [96] not matched with loaded params conv9.bottleneck_conv.bn.bias [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.conv.weight [96, 1, 3, 3] not matched with loaded params conv9.bottleneck_conv.bn._mean [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn.weight [96] not matched with loaded params conv9.bottleneck_conv.bn._variance [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn.bias [96] not matched with loaded params conv9.linear_conv.conv.weight [40, 104, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn._mean [96] not matched with loaded params conv9.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn._variance [96] not matched with loaded params conv9.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.conv.weight [40, 96, 1, 1] not matched with loaded params conv9.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn.bias [40] not matched with loaded params conv10.expand_conv.conv.weight [96, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn._mean [40] not matched with loaded params conv10.expand_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn._variance [40] not matched with loaded params conv10.expand_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.expand_conv.conv.weight [96, 40, 1, 1] not matched with loaded params conv10.expand_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.expand_conv.bn.bias [96] not matched with loaded params conv10.bottleneck_conv.conv.weight [96, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.conv.weight [96, 1, 3, 3] not matched with loaded params conv10.bottleneck_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn.bias [96] not matched with loaded params conv10.linear_conv.conv.weight [40, 96, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn._mean [96] not matched with loaded params conv10.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn._variance [96] not matched with loaded params conv10.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.conv.weight [40, 96, 1, 1] not matched with loaded params conv10.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn.bias [40] not matched with loaded params conv11.expand_conv.conv.weight [96, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn._mean [40] not matched with loaded params conv11.expand_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn._variance [40] not matched with loaded params conv11.expand_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.conv.weight [240, 40, 1, 1] not matched with loaded params conv11.expand_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn.weight [240] not matched with loaded params conv11.expand_conv.bn._variance [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn.bias [240] not matched with loaded params conv11.bottleneck_conv.conv.weight [96, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn._mean [240] not matched with loaded params conv11.bottleneck_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn._variance [240] not matched with loaded params conv11.bottleneck_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.conv.weight [240, 1, 3, 3] not matched with loaded params conv11.bottleneck_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn.weight [240] not matched with loaded params conv11.bottleneck_conv.bn._variance [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn.bias [240] not matched with loaded params conv11.linear_conv.conv.weight [40, 96, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn._mean [240] not matched with loaded params conv11.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn._variance [240] not matched with loaded params conv11.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.conv.weight [56, 240, 1, 1] not matched with loaded params conv11.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn.weight [56] not matched with loaded params conv11.linear_conv.bn._variance [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn.bias [56] not matched with loaded params conv12.expand_conv.conv.weight [240, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn._mean [56] not matched with loaded params conv12.expand_conv.bn.weight [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn._variance [56] not matched with loaded params conv12.expand_conv.bn.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.conv.weight [336, 56, 1, 1] not matched with loaded params conv12.expand_conv.bn._mean [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn.weight [336] not matched with loaded params conv12.expand_conv.bn._variance [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn.bias [336] not matched with loaded params conv12.bottleneck_conv.conv.weight [240, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn._mean [336] not matched with loaded params conv12.bottleneck_conv.bn.weight [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn._variance [336] not matched with loaded params conv12.bottleneck_conv.bn.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.conv.weight [336, 1, 3, 3] not matched with loaded params conv12.bottleneck_conv.bn._mean [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn.weight [336] not matched with loaded params conv12.bottleneck_conv.bn._variance [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn.bias [336] not matched with loaded params conv12.mid_se.conv1.weight [60, 240, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn._mean [336] not matched with loaded params conv12.mid_se.conv1.bias [60] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn._variance [336] not matched with loaded params conv12.mid_se.conv2.weight [240, 60, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.linear_conv.conv.weight [56, 336, 1, 1] not matched with loaded params conv12.mid_se.conv2.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.linear_conv.bn.weight [56] not matched with loaded params conv12.linear_conv.conv.weight [56, 240, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.expand_conv.conv.weight [336, 56, 1, 1] not matched with loaded params conv12.linear_conv.bn._variance [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.expand_conv.bn.weight [336] not matched with loaded params conv13.expand_conv.conv.weight [336, 56, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.bottleneck_conv.conv.weight [336, 1, 5, 5] not matched with loaded params conv13.expand_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.bottleneck_conv.bn.weight [336] not matched with loaded params conv13.bottleneck_conv.conv.weight [336, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.conv.weight [80, 336, 1, 1] not matched with loaded params conv13.bottleneck_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn.weight [80] not matched with loaded params conv13.mid_se.conv1.weight [84, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn.bias [80] not matched with loaded params conv13.mid_se.conv1.bias [84] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn._mean [80] not matched with loaded params conv13.mid_se.conv2.weight [336, 84, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn._variance [80] not matched with loaded params conv13.mid_se.conv2.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.conv.weight [480, 80, 1, 1] not matched with loaded params conv13.linear_conv.conv.weight [56, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn.weight [480] not matched with loaded params conv13.linear_conv.bn.weight [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn.bias [480] not matched with loaded params conv13.linear_conv.bn.bias [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn._mean [480] not matched with loaded params conv13.linear_conv.bn._mean [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn._variance [480] not matched with loaded params conv13.linear_conv.bn._variance [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.conv.weight [480, 1, 5, 5] not matched with loaded params conv14.expand_conv.conv.weight [336, 56, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn.weight [480] not matched with loaded params conv14.expand_conv.bn.weight [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn.bias [480] not matched with loaded params conv14.expand_conv.bn.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn._mean [480] not matched with loaded params conv14.expand_conv.bn._mean [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn._variance [480] not matched with loaded params conv14.expand_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.conv.weight [80, 480, 1, 1] not matched with loaded params conv14.bottleneck_conv.conv.weight [336, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn.weight [80] not matched with loaded params conv14.bottleneck_conv.bn.weight [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn.bias [80] not matched with loaded params conv14.bottleneck_conv.bn.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn._mean [80] not matched with loaded params conv14.bottleneck_conv.bn._mean [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn._variance [80] not matched with loaded params conv14.bottleneck_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.conv.weight [480, 80, 1, 1] not matched with loaded params conv14.mid_se.conv1.weight [84, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn.weight [480] not matched with loaded params conv14.mid_se.conv1.bias [84] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn.bias [480] not matched with loaded params conv14.mid_se.conv2.weight [336, 84, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn._mean [480] not matched with loaded params conv14.mid_se.conv2.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn._variance [480] not matched with loaded params conv14.linear_conv.conv.weight [80, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.conv.weight [480, 1, 5, 5] not matched with loaded params conv14.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn.weight [480] not matched with loaded params conv14.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn.bias [480] not matched with loaded params conv14.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn._mean [480] not matched with loaded params conv14.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn._variance [480] not matched with loaded params conv15.expand_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.conv.weight [80, 480, 1, 1] not matched with loaded params conv15.expand_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn.weight [80] not matched with loaded params conv15.expand_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn.bias [80] not matched with loaded params conv15.expand_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn._mean [80] not matched with loaded params conv15.expand_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn._variance [80] not matched with loaded params conv15.bottleneck_conv.conv.weight [480, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.3.conv.weight [480, 80, 1, 1] not matched with loaded params conv15.bottleneck_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.3.bn._variance [480] not matched with loaded params conv15.mid_se.conv1.weight [120, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.in_conv.weight [96, 16, 1, 1] not matched with loaded params conv15.mid_se.conv1.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv15.mid_se.conv2.weight [480, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv1.bias [24] not matched with loaded params conv15.mid_se.conv2.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv15.linear_conv.conv.weight [80, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv2.bias [96] not matched with loaded params conv15.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.in_conv.weight [96, 24, 1, 1] not matched with loaded params conv15.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv15.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv1.bias [24] not matched with loaded params conv15.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.expand_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv2.bias [96] not matched with loaded params conv16.expand_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.in_conv.weight [96, 56, 1, 1] not matched with loaded params conv16.expand_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv16.expand_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv1.bias [24] not matched with loaded params conv16.expand_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.bottleneck_conv.conv.weight [480, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv2.bias [96] not matched with loaded params conv16.bottleneck_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.in_conv.weight [96, 480, 1, 1] not matched with loaded params conv16.bottleneck_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv16.bottleneck_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv1.bias [24] not matched with loaded params conv16.bottleneck_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.mid_se.conv1.weight [120, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv2.bias [96] not matched with loaded params conv16.mid_se.conv1.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.in_conv.weight [24, 96, 3, 3] not matched with loaded params conv16.mid_se.conv2.weight [480, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params conv16.mid_se.conv2.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv1.bias [6] not matched with loaded params conv16.linear_conv.conv.weight [80, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params conv16.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv2.bias [24] not matched with loaded params conv16.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.in_conv.weight [24, 96, 3, 3] not matched with loaded params conv16.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params conv16.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv1.bias [6] not matched with loaded params last_second_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params last_second_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv2.bias [24] not matched with loaded params last_second_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.in_conv.weight [24, 96, 3, 3] not matched with loaded params last_second_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params last_second_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv1.bias [6] not matched with loaded params last_conv.weight [1280, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params out.weight [1280, 1000] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv2.bias [24] not matched with loaded params out.bias [1000] !

Originally posted by @Zhang-O in https://github.com/PaddlePaddle/PaddleOCR/issues/6684#issuecomment-1186534966

Zhang-O commented 2 years ago

你用的代码分支是?

paddleOcr 2.3 里面加载 pretrained model 用的下面的函数 这个是根据shape匹配权重的

def load_dygraph_params(config, model, logger, optimizer):
    ckp = config['Global']['checkpoints']
    if ckp and os.path.exists(ckp + ".pdparams"):
        pre_best_model_dict = init_model(config, model, optimizer)
        return pre_best_model_dict
    else:
        pm = config['Global']['pretrained_model']
        if pm is None:
            return {}
        if not os.path.exists(pm) and not os.path.exists(pm + ".pdparams"):
            logger.info(f"The pretrained_model {pm} does not exists!")
            return {}
        pm = pm if pm.endswith('.pdparams') else pm + '.pdparams'
        params = paddle.load(pm)
        state_dict = model.state_dict()
        new_state_dict = {}
        for k1, k2 in zip(state_dict.keys(), params.keys()):
            if list(state_dict[k1].shape) == list(params[k2].shape):
                new_state_dict[k1] = params[k2]
            else:
                logger.info(
                    f"The shape of model params {k1} {state_dict[k1].shape} not matched with loaded params {k2} {params[k2].shape} !"
                )
        model.set_state_dict(new_state_dict)
        logger.info(f"loaded pretrained_model successful from {pm}")
        return {}

paddleOcr 2.5 里面加载 pretrained model 用的下面的函数 这个是根据 key 的 key name 匹配权重的

def load_pretrained_params(model, path):
    logger = get_logger()
    if path.endswith('.pdparams'):
        path = path.replace('.pdparams', '')
    assert os.path.exists(path + ".pdparams"), \
        "The {}.pdparams does not exists!".format(path)

    params = paddle.load(path + '.pdparams')
    state_dict = model.state_dict()
    new_state_dict = {}
    for k1 in params.keys():
        if k1 not in state_dict.keys():
            logger.warning("The pretrained params {} not in model".format(k1))
        else:
            if list(state_dict[k1].shape) == list(params[k1].shape):
                new_state_dict[k1] = params[k1]
            else:
                logger.warning(
                    "The shape of model params {} {} not matched with loaded params {} {} !".
                    format(k1, state_dict[k1].shape, k1, params[k1].shape))
    model.set_state_dict(new_state_dict)
    logger.info("load pretrain successful from {}".format(path))
    return model

上面的问题就是由于这个改动造成的。

另外在使用 ch_PP-OCRv3_det_cml.yml 进行cml 蒸馏时,student 模型加载预训练模型,原始的日志是作者上面发的那些,改用2.3的 load_dygraph_params 加载 预训练模型,输出的日志是下面的这些,new_state_dict 大约匹配84个key。 这里 student 模型 是否加载预训练模型 区别大吗?

[2022/07/17 14:08:07] ppocr INFO: Architecture : 
[2022/07/17 14:08:07] ppocr INFO:     Models : 
[2022/07/17 14:08:07] ppocr INFO:         Student : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 disable_se : True
[2022/07/17 14:08:07] ppocr INFO:                 model_name : large
[2022/07/17 14:08:07] ppocr INFO:                 name : MobileNetV3
[2022/07/17 14:08:07] ppocr INFO:                 scale : 0.5
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : RSEFPN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 96
[2022/07/17 14:08:07] ppocr INFO:                 shortcut : True
[2022/07/17 14:08:07] ppocr INFO:             Transform : None
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/pretrained/MobileNetV3_large_x0_5_pretrained
[2022/07/17 14:08:07] ppocr INFO:         Student2 : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 disable_se : True
[2022/07/17 14:08:07] ppocr INFO:                 model_name : large
[2022/07/17 14:08:07] ppocr INFO:                 name : MobileNetV3
[2022/07/17 14:08:07] ppocr INFO:                 scale : 0.5
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : RSEFPN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 96
[2022/07/17 14:08:07] ppocr INFO:                 shortcut : True
[2022/07/17 14:08:07] ppocr INFO:             Transform : None
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/pretrained/MobileNetV3_large_x0_5_pretrained
[2022/07/17 14:08:07] ppocr INFO:         Teacher : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 in_channels : 3
[2022/07/17 14:08:07] ppocr INFO:                 layers : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : ResNet
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 kernel_list : [7, 2, 2]
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : LKPAN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 224
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             freeze_params : True
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/db_0629_v1/student
[2022/07/17 14:08:07] ppocr INFO:             return_all_feats : False
[2022/07/17 14:08:07] ppocr INFO:     algorithm : Distillation
[2022/07/17 14:08:07] ppocr INFO:     model_type : det
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationModel
[2022/07/17 14:08:07] ppocr INFO: Eval : 
[2022/07/17 14:08:07] ppocr INFO:     dataset : 
[2022/07/17 14:08:07] ppocr INFO:         data_dir : None
[2022/07/17 14:08:07] ppocr INFO:         label_file_list : ['custom/data/det_word_0421_val.txt']
[2022/07/17 14:08:07] ppocr INFO:         name : SimpleDataSet
[2022/07/17 14:08:07] ppocr INFO:         transforms : 
[2022/07/17 14:08:07] ppocr INFO:             DecodeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 channel_first : False
[2022/07/17 14:08:07] ppocr INFO:                 img_mode : BGR
[2022/07/17 14:08:07] ppocr INFO:             DetLabelEncode : None
[2022/07/17 14:08:07] ppocr INFO:             DetResizeForTest : None
[2022/07/17 14:08:07] ppocr INFO:             NormalizeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 mean : [0.485, 0.456, 0.406]
[2022/07/17 14:08:07] ppocr INFO:                 order : hwc
[2022/07/17 14:08:07] ppocr INFO:                 scale : 1./255.
[2022/07/17 14:08:07] ppocr INFO:                 std : [0.229, 0.224, 0.225]
[2022/07/17 14:08:07] ppocr INFO:             ToCHWImage : None
[2022/07/17 14:08:07] ppocr INFO:             KeepKeys : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_keys : ['image', 'shape', 'polys', 'ignore_tags']
[2022/07/17 14:08:07] ppocr INFO:     loader : 
[2022/07/17 14:08:07] ppocr INFO:         batch_size_per_card : 1
[2022/07/17 14:08:07] ppocr INFO:         drop_last : False
[2022/07/17 14:08:07] ppocr INFO:         num_workers : 1
[2022/07/17 14:08:07] ppocr INFO:         shuffle : False
[2022/07/17 14:08:07] ppocr INFO:         use_shared_memory : False
[2022/07/17 14:08:07] ppocr INFO: Global : 
[2022/07/17 14:08:07] ppocr INFO:     cal_metric_during_train : False
[2022/07/17 14:08:07] ppocr INFO:     checkpoints : None
[2022/07/17 14:08:07] ppocr INFO:     debug : False
[2022/07/17 14:08:07] ppocr INFO:     distributed : False
[2022/07/17 14:08:07] ppocr INFO:     epoch_num : 500
[2022/07/17 14:08:07] ppocr INFO:     eval_batch_step : [0, 400]
[2022/07/17 14:08:07] ppocr INFO:     infer_img : doc/imgs_en/img_10.jpg
[2022/07/17 14:08:07] ppocr INFO:     log_smooth_window : 20
[2022/07/17 14:08:07] ppocr INFO:     pretrained_model : None
[2022/07/17 14:08:07] ppocr INFO:     print_batch_step : 10
[2022/07/17 14:08:07] ppocr INFO:     save_epoch_step : 100
[2022/07/17 14:08:07] ppocr INFO:     save_inference_dir : None
[2022/07/17 14:08:07] ppocr INFO:     save_model_dir : ./models/det/db_test/
[2022/07/17 14:08:07] ppocr INFO:     save_res_path : ./checkpoints/det_db/predicts_db.txt
[2022/07/17 14:08:07] ppocr INFO:     use_gpu : False
[2022/07/17 14:08:07] ppocr INFO:     use_visualdl : False
[2022/07/17 14:08:07] ppocr INFO: Loss : 
[2022/07/17 14:08:07] ppocr INFO:     loss_config_list : 
[2022/07/17 14:08:07] ppocr INFO:         DistillationDilaDBLoss : 
[2022/07/17 14:08:07] ppocr INFO:             alpha : 5
[2022/07/17 14:08:07] ppocr INFO:             balance_loss : True
[2022/07/17 14:08:07] ppocr INFO:             beta : 10
[2022/07/17 14:08:07] ppocr INFO:             key : maps
[2022/07/17 14:08:07] ppocr INFO:             main_loss_type : DiceLoss
[2022/07/17 14:08:07] ppocr INFO:             model_name_pairs : [['Student', 'Teacher'], ['Student2', 'Teacher']]
[2022/07/17 14:08:07] ppocr INFO:             ohem_ratio : 3
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:         DistillationDMLLoss : 
[2022/07/17 14:08:07] ppocr INFO:             key : maps
[2022/07/17 14:08:07] ppocr INFO:             maps_name : thrink_maps
[2022/07/17 14:08:07] ppocr INFO:             model_name_pairs : ['Student', 'Student2']
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:         DistillationDBLoss : 
[2022/07/17 14:08:07] ppocr INFO:             alpha : 5
[2022/07/17 14:08:07] ppocr INFO:             balance_loss : True
[2022/07/17 14:08:07] ppocr INFO:             beta : 10
[2022/07/17 14:08:07] ppocr INFO:             main_loss_type : DiceLoss
[2022/07/17 14:08:07] ppocr INFO:             model_name_list : ['Student', 'Student2']
[2022/07/17 14:08:07] ppocr INFO:             ohem_ratio : 3
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:     name : CombinedLoss
[2022/07/17 14:08:07] ppocr INFO: Metric : 
[2022/07/17 14:08:07] ppocr INFO:     base_metric_name : DetMetric
[2022/07/17 14:08:07] ppocr INFO:     key : Student
[2022/07/17 14:08:07] ppocr INFO:     main_indicator : hmean
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationMetric
[2022/07/17 14:08:07] ppocr INFO: Optimizer : 
[2022/07/17 14:08:07] ppocr INFO:     beta1 : 0.9
[2022/07/17 14:08:07] ppocr INFO:     beta2 : 0.999
[2022/07/17 14:08:07] ppocr INFO:     lr : 
[2022/07/17 14:08:07] ppocr INFO:         learning_rate : 0.001
[2022/07/17 14:08:07] ppocr INFO:         name : Cosine
[2022/07/17 14:08:07] ppocr INFO:         warmup_epoch : 2
[2022/07/17 14:08:07] ppocr INFO:     name : Adam
[2022/07/17 14:08:07] ppocr INFO:     regularizer : 
[2022/07/17 14:08:07] ppocr INFO:         factor : 5e-05
[2022/07/17 14:08:07] ppocr INFO:         name : L2
[2022/07/17 14:08:07] ppocr INFO: PostProcess : 
[2022/07/17 14:08:07] ppocr INFO:     box_thresh : 0.6
[2022/07/17 14:08:07] ppocr INFO:     key : head_out
[2022/07/17 14:08:07] ppocr INFO:     max_candidates : 1000
[2022/07/17 14:08:07] ppocr INFO:     model_name : ['Student']
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationDBPostProcess
[2022/07/17 14:08:07] ppocr INFO:     thresh : 0.3
[2022/07/17 14:08:07] ppocr INFO:     unclip_ratio : 1.5
[2022/07/17 14:08:07] ppocr INFO: Train : 
[2022/07/17 14:08:07] ppocr INFO:     dataset : 
[2022/07/17 14:08:07] ppocr INFO:         data_dir : None
[2022/07/17 14:08:07] ppocr INFO:         label_file_list : ['custom/data/det_word_0421_train.txt']
[2022/07/17 14:08:07] ppocr INFO:         name : SimpleDataSet
[2022/07/17 14:08:07] ppocr INFO:         ratio_list : [1.0]
[2022/07/17 14:08:07] ppocr INFO:         transforms : 
[2022/07/17 14:08:07] ppocr INFO:             DecodeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 channel_first : False
[2022/07/17 14:08:07] ppocr INFO:                 img_mode : BGR
[2022/07/17 14:08:07] ppocr INFO:             DetLabelEncode : None
[2022/07/17 14:08:07] ppocr INFO:             CopyPaste : None
[2022/07/17 14:08:07] ppocr INFO:             IaaAugment : 
[2022/07/17 14:08:07] ppocr INFO:                 augmenter_args : 
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         p : 0.5
[2022/07/17 14:08:07] ppocr INFO:                     type : Fliplr
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         rotate : [-10, 10]
[2022/07/17 14:08:07] ppocr INFO:                     type : Affine
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         size : [0.5, 3]
[2022/07/17 14:08:07] ppocr INFO:                     type : Resize
[2022/07/17 14:08:07] ppocr INFO:             EastRandomCropData : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_ratio : True
[2022/07/17 14:08:07] ppocr INFO:                 max_tries : 50
[2022/07/17 14:08:07] ppocr INFO:                 size : [640, 640]
[2022/07/17 14:08:07] ppocr INFO:             MakeBorderMap : 
[2022/07/17 14:08:07] ppocr INFO:                 shrink_ratio : 0.4
[2022/07/17 14:08:07] ppocr INFO:                 thresh_max : 0.7
[2022/07/17 14:08:07] ppocr INFO:                 thresh_min : 0.3
[2022/07/17 14:08:07] ppocr INFO:             MakeShrinkMap : 
[2022/07/17 14:08:07] ppocr INFO:                 min_text_size : 8
[2022/07/17 14:08:07] ppocr INFO:                 shrink_ratio : 0.4
[2022/07/17 14:08:07] ppocr INFO:             NormalizeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 mean : [0.485, 0.456, 0.406]
[2022/07/17 14:08:07] ppocr INFO:                 order : hwc
[2022/07/17 14:08:07] ppocr INFO:                 scale : 1./255.
[2022/07/17 14:08:07] ppocr INFO:                 std : [0.229, 0.224, 0.225]
[2022/07/17 14:08:07] ppocr INFO:             ToCHWImage : None
[2022/07/17 14:08:07] ppocr INFO:             KeepKeys : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_keys : ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask']
[2022/07/17 14:08:07] ppocr INFO:     loader : 
[2022/07/17 14:08:07] ppocr INFO:         batch_size_per_card : 4
[2022/07/17 14:08:07] ppocr INFO:         drop_last : False
[2022/07/17 14:08:07] ppocr INFO:         num_workers : 1
[2022/07/17 14:08:07] ppocr INFO:         shuffle : True
[2022/07/17 14:08:07] ppocr INFO:         use_shared_memory : False
[2022/07/17 14:08:07] ppocr INFO: profiler_options : None
[2022/07/17 14:08:07] ppocr INFO: train with paddle 2.1.2 and device CPUPlace
[2022/07/17 14:08:14] ppocr INFO: Initialize indexs of datasets:['custom/data/det_word_0421_train.txt']
[2022/07/17 14:08:14] ppocr INFO: Initialize indexs of datasets:['custom/data/det_word_0421_val.txt']
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.conv.weight [24, 40, 1, 1] not matched with loaded params conv5.mid_se.conv1.weight [10, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn.weight [24] not matched with loaded params conv5.mid_se.conv1.bias [10] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn.bias [24] not matched with loaded params conv5.mid_se.conv2.weight [40, 10, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn._mean [24] not matched with loaded params conv5.mid_se.conv2.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn._variance [24] not matched with loaded params conv5.linear_conv.conv.weight [24, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.conv.weight [64, 24, 1, 1] not matched with loaded params conv5.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn.weight [64] not matched with loaded params conv5.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn.bias [64] not matched with loaded params conv5.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn._mean [64] not matched with loaded params conv5.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn._variance [64] not matched with loaded params conv6.expand_conv.conv.weight [64, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.bottleneck_conv.conv.weight [64, 1, 5, 5] not matched with loaded params conv6.expand_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.bottleneck_conv.bn._variance [64] not matched with loaded params conv6.bottleneck_conv.conv.weight [64, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.conv.weight [24, 64, 1, 1] not matched with loaded params conv6.bottleneck_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn.weight [24] not matched with loaded params conv6.bottleneck_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn.bias [24] not matched with loaded params conv6.bottleneck_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn._mean [24] not matched with loaded params conv6.bottleneck_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn._variance [24] not matched with loaded params conv6.mid_se.conv1.weight [16, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.conv.weight [64, 24, 1, 1] not matched with loaded params conv6.mid_se.conv1.bias [16] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn.weight [64] not matched with loaded params conv6.mid_se.conv2.weight [64, 16, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn._mean [64] not matched with loaded params conv6.linear_conv.conv.weight [24, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn._variance [64] not matched with loaded params conv6.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.conv.weight [64, 1, 5, 5] not matched with loaded params conv6.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn.weight [64] not matched with loaded params conv6.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn.bias [64] not matched with loaded params conv6.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn._mean [64] not matched with loaded params conv7.expand_conv.conv.weight [64, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.conv.weight [24, 64, 1, 1] not matched with loaded params conv7.expand_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn.weight [24] not matched with loaded params conv7.expand_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn.bias [24] not matched with loaded params conv7.expand_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn._mean [24] not matched with loaded params conv7.bottleneck_conv.conv.weight [64, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn._variance [24] not matched with loaded params conv7.bottleneck_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.conv.weight [120, 24, 1, 1] not matched with loaded params conv7.bottleneck_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn.weight [120] not matched with loaded params conv7.bottleneck_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn.bias [120] not matched with loaded params conv7.bottleneck_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn._mean [120] not matched with loaded params conv7.mid_se.conv1.weight [16, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn._variance [120] not matched with loaded params conv7.mid_se.conv1.bias [16] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.conv.weight [120, 1, 3, 3] not matched with loaded params conv7.mid_se.conv2.weight [64, 16, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn.weight [120] not matched with loaded params conv7.mid_se.conv2.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn.bias [120] not matched with loaded params conv7.linear_conv.conv.weight [24, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn._mean [120] not matched with loaded params conv7.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn._variance [120] not matched with loaded params conv7.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.conv.weight [40, 120, 1, 1] not matched with loaded params conv7.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn.weight [40] not matched with loaded params conv7.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn.bias [40] not matched with loaded params conv8.expand_conv.conv.weight [120, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn._mean [40] not matched with loaded params conv8.expand_conv.bn.weight [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn._variance [40] not matched with loaded params conv8.expand_conv.bn.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.conv.weight [104, 40, 1, 1] not matched with loaded params conv8.expand_conv.bn._mean [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn.weight [104] not matched with loaded params conv8.expand_conv.bn._variance [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn.bias [104] not matched with loaded params conv8.bottleneck_conv.conv.weight [120, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn._mean [104] not matched with loaded params conv8.bottleneck_conv.bn.weight [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn._variance [104] not matched with loaded params conv8.bottleneck_conv.bn.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.conv.weight [104, 1, 3, 3] not matched with loaded params conv8.bottleneck_conv.bn._mean [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn.weight [104] not matched with loaded params conv8.bottleneck_conv.bn._variance [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn.bias [104] not matched with loaded params conv8.linear_conv.conv.weight [40, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn._mean [104] not matched with loaded params conv8.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn._variance [104] not matched with loaded params conv8.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.conv.weight [40, 104, 1, 1] not matched with loaded params conv8.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn.bias [40] not matched with loaded params conv9.expand_conv.conv.weight [104, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn._mean [40] not matched with loaded params conv9.expand_conv.bn.weight [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn._variance [40] not matched with loaded params conv9.expand_conv.bn.bias [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.conv.weight [96, 40, 1, 1] not matched with loaded params conv9.expand_conv.bn._mean [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn.weight [96] not matched with loaded params conv9.expand_conv.bn._variance [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn.bias [96] not matched with loaded params conv9.bottleneck_conv.conv.weight [104, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn._mean [96] not matched with loaded params conv9.bottleneck_conv.bn.weight [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn._variance [96] not matched with loaded params conv9.bottleneck_conv.bn.bias [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.conv.weight [96, 1, 3, 3] not matched with loaded params conv9.bottleneck_conv.bn._mean [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn.weight [96] not matched with loaded params conv9.bottleneck_conv.bn._variance [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn.bias [96] not matched with loaded params conv9.linear_conv.conv.weight [40, 104, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn._mean [96] not matched with loaded params conv9.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn._variance [96] not matched with loaded params conv9.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.conv.weight [40, 96, 1, 1] not matched with loaded params conv9.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn.bias [40] not matched with loaded params conv10.expand_conv.conv.weight [96, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn._mean [40] not matched with loaded params conv10.expand_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn._variance [40] not matched with loaded params conv10.expand_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.expand_conv.conv.weight [96, 40, 1, 1] not matched with loaded params conv10.expand_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.expand_conv.bn.bias [96] not matched with loaded params conv10.bottleneck_conv.conv.weight [96, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.conv.weight [96, 1, 3, 3] not matched with loaded params conv10.bottleneck_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn.bias [96] not matched with loaded params conv10.linear_conv.conv.weight [40, 96, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn._mean [96] not matched with loaded params conv10.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn._variance [96] not matched with loaded params conv10.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.conv.weight [40, 96, 1, 1] not matched with loaded params conv10.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn.bias [40] not matched with loaded params conv11.expand_conv.conv.weight [96, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn._mean [40] not matched with loaded params conv11.expand_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn._variance [40] not matched with loaded params conv11.expand_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.conv.weight [240, 40, 1, 1] not matched with loaded params conv11.expand_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn.weight [240] not matched with loaded params conv11.expand_conv.bn._variance [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn.bias [240] not matched with loaded params conv11.bottleneck_conv.conv.weight [96, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn._mean [240] not matched with loaded params conv11.bottleneck_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn._variance [240] not matched with loaded params conv11.bottleneck_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.conv.weight [240, 1, 3, 3] not matched with loaded params conv11.bottleneck_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn.weight [240] not matched with loaded params conv11.bottleneck_conv.bn._variance [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn.bias [240] not matched with loaded params conv11.linear_conv.conv.weight [40, 96, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn._mean [240] not matched with loaded params conv11.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn._variance [240] not matched with loaded params conv11.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.conv.weight [56, 240, 1, 1] not matched with loaded params conv11.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn.weight [56] not matched with loaded params conv11.linear_conv.bn._variance [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn.bias [56] not matched with loaded params conv12.expand_conv.conv.weight [240, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn._mean [56] not matched with loaded params conv12.expand_conv.bn.weight [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn._variance [56] not matched with loaded params conv12.expand_conv.bn.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.conv.weight [336, 56, 1, 1] not matched with loaded params conv12.expand_conv.bn._mean [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn.weight [336] not matched with loaded params conv12.expand_conv.bn._variance [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn.bias [336] not matched with loaded params conv12.bottleneck_conv.conv.weight [240, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn._mean [336] not matched with loaded params conv12.bottleneck_conv.bn.weight [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn._variance [336] not matched with loaded params conv12.bottleneck_conv.bn.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.conv.weight [336, 1, 3, 3] not matched with loaded params conv12.bottleneck_conv.bn._mean [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn.weight [336] not matched with loaded params conv12.bottleneck_conv.bn._variance [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn.bias [336] not matched with loaded params conv12.mid_se.conv1.weight [60, 240, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn._mean [336] not matched with loaded params conv12.mid_se.conv1.bias [60] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn._variance [336] not matched with loaded params conv12.mid_se.conv2.weight [240, 60, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.linear_conv.conv.weight [56, 336, 1, 1] not matched with loaded params conv12.mid_se.conv2.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.linear_conv.bn.weight [56] not matched with loaded params conv12.linear_conv.conv.weight [56, 240, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.expand_conv.conv.weight [336, 56, 1, 1] not matched with loaded params conv12.linear_conv.bn._variance [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.expand_conv.bn.weight [336] not matched with loaded params conv13.expand_conv.conv.weight [336, 56, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.bottleneck_conv.conv.weight [336, 1, 5, 5] not matched with loaded params conv13.expand_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.bottleneck_conv.bn.weight [336] not matched with loaded params conv13.bottleneck_conv.conv.weight [336, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.conv.weight [80, 336, 1, 1] not matched with loaded params conv13.bottleneck_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn.weight [80] not matched with loaded params conv13.mid_se.conv1.weight [84, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn.bias [80] not matched with loaded params conv13.mid_se.conv1.bias [84] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn._mean [80] not matched with loaded params conv13.mid_se.conv2.weight [336, 84, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn._variance [80] not matched with loaded params conv13.mid_se.conv2.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.conv.weight [480, 80, 1, 1] not matched with loaded params conv13.linear_conv.conv.weight [56, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn.weight [480] not matched with loaded params conv13.linear_conv.bn.weight [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn.bias [480] not matched with loaded params conv13.linear_conv.bn.bias [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn._mean [480] not matched with loaded params conv13.linear_conv.bn._mean [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn._variance [480] not matched with loaded params conv13.linear_conv.bn._variance [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.conv.weight [480, 1, 5, 5] not matched with loaded params conv14.expand_conv.conv.weight [336, 56, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn.weight [480] not matched with loaded params conv14.expand_conv.bn.weight [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn.bias [480] not matched with loaded params conv14.expand_conv.bn.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn._mean [480] not matched with loaded params conv14.expand_conv.bn._mean [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn._variance [480] not matched with loaded params conv14.expand_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.conv.weight [80, 480, 1, 1] not matched with loaded params conv14.bottleneck_conv.conv.weight [336, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn.weight [80] not matched with loaded params conv14.bottleneck_conv.bn.weight [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn.bias [80] not matched with loaded params conv14.bottleneck_conv.bn.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn._mean [80] not matched with loaded params conv14.bottleneck_conv.bn._mean [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn._variance [80] not matched with loaded params conv14.bottleneck_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.conv.weight [480, 80, 1, 1] not matched with loaded params conv14.mid_se.conv1.weight [84, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn.weight [480] not matched with loaded params conv14.mid_se.conv1.bias [84] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn.bias [480] not matched with loaded params conv14.mid_se.conv2.weight [336, 84, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn._mean [480] not matched with loaded params conv14.mid_se.conv2.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn._variance [480] not matched with loaded params conv14.linear_conv.conv.weight [80, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.conv.weight [480, 1, 5, 5] not matched with loaded params conv14.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn.weight [480] not matched with loaded params conv14.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn.bias [480] not matched with loaded params conv14.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn._mean [480] not matched with loaded params conv14.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn._variance [480] not matched with loaded params conv15.expand_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.conv.weight [80, 480, 1, 1] not matched with loaded params conv15.expand_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn.weight [80] not matched with loaded params conv15.expand_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn.bias [80] not matched with loaded params conv15.expand_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn._mean [80] not matched with loaded params conv15.expand_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn._variance [80] not matched with loaded params conv15.bottleneck_conv.conv.weight [480, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.3.conv.weight [480, 80, 1, 1] not matched with loaded params conv15.bottleneck_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.3.bn._variance [480] not matched with loaded params conv15.mid_se.conv1.weight [120, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.in_conv.weight [96, 16, 1, 1] not matched with loaded params conv15.mid_se.conv1.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv15.mid_se.conv2.weight [480, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv1.bias [24] not matched with loaded params conv15.mid_se.conv2.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv15.linear_conv.conv.weight [80, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv2.bias [96] not matched with loaded params conv15.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.in_conv.weight [96, 24, 1, 1] not matched with loaded params conv15.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv15.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv1.bias [24] not matched with loaded params conv15.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.expand_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv2.bias [96] not matched with loaded params conv16.expand_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.in_conv.weight [96, 56, 1, 1] not matched with loaded params conv16.expand_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv16.expand_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv1.bias [24] not matched with loaded params conv16.expand_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.bottleneck_conv.conv.weight [480, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv2.bias [96] not matched with loaded params conv16.bottleneck_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.in_conv.weight [96, 480, 1, 1] not matched with loaded params conv16.bottleneck_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv16.bottleneck_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv1.bias [24] not matched with loaded params conv16.bottleneck_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.mid_se.conv1.weight [120, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv2.bias [96] not matched with loaded params conv16.mid_se.conv1.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.in_conv.weight [24, 96, 3, 3] not matched with loaded params conv16.mid_se.conv2.weight [480, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params conv16.mid_se.conv2.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv1.bias [6] not matched with loaded params conv16.linear_conv.conv.weight [80, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params conv16.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv2.bias [24] not matched with loaded params conv16.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.in_conv.weight [24, 96, 3, 3] not matched with loaded params conv16.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params conv16.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv1.bias [6] not matched with loaded params last_second_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params last_second_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv2.bias [24] not matched with loaded params last_second_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.in_conv.weight [24, 96, 3, 3] not matched with loaded params last_second_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params last_second_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv1.bias [6] not matched with loaded params last_conv.weight [1280, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params out.weight [1280, 1000] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv2.bias [24] not matched with loaded params out.bias [1000] !

Originally posted by @Zhang-O in #6684 (comment)

2.3 和 2.5 都用,目前蒸馏DBnet 用2.5

Akumio commented 2 years ago

你用的代码分支是?

paddleOcr 2.3 里面加载 pretrained model 用的下面的函数 这个是根据shape匹配权重的

def load_dygraph_params(config, model, logger, optimizer):
    ckp = config['Global']['checkpoints']
    if ckp and os.path.exists(ckp + ".pdparams"):
        pre_best_model_dict = init_model(config, model, optimizer)
        return pre_best_model_dict
    else:
        pm = config['Global']['pretrained_model']
        if pm is None:
            return {}
        if not os.path.exists(pm) and not os.path.exists(pm + ".pdparams"):
            logger.info(f"The pretrained_model {pm} does not exists!")
            return {}
        pm = pm if pm.endswith('.pdparams') else pm + '.pdparams'
        params = paddle.load(pm)
        state_dict = model.state_dict()
        new_state_dict = {}
        for k1, k2 in zip(state_dict.keys(), params.keys()):
            if list(state_dict[k1].shape) == list(params[k2].shape):
                new_state_dict[k1] = params[k2]
            else:
                logger.info(
                    f"The shape of model params {k1} {state_dict[k1].shape} not matched with loaded params {k2} {params[k2].shape} !"
                )
        model.set_state_dict(new_state_dict)
        logger.info(f"loaded pretrained_model successful from {pm}")
        return {}

paddleOcr 2.5 里面加载 pretrained model 用的下面的函数 这个是根据 key 的 key name 匹配权重的

def load_pretrained_params(model, path):
    logger = get_logger()
    if path.endswith('.pdparams'):
        path = path.replace('.pdparams', '')
    assert os.path.exists(path + ".pdparams"), \
        "The {}.pdparams does not exists!".format(path)

    params = paddle.load(path + '.pdparams')
    state_dict = model.state_dict()
    new_state_dict = {}
    for k1 in params.keys():
        if k1 not in state_dict.keys():
            logger.warning("The pretrained params {} not in model".format(k1))
        else:
            if list(state_dict[k1].shape) == list(params[k1].shape):
                new_state_dict[k1] = params[k1]
            else:
                logger.warning(
                    "The shape of model params {} {} not matched with loaded params {} {} !".
                    format(k1, state_dict[k1].shape, k1, params[k1].shape))
    model.set_state_dict(new_state_dict)
    logger.info("load pretrain successful from {}".format(path))
    return model

上面的问题就是由于这个改动造成的。 另外在使用 ch_PP-OCRv3_det_cml.yml 进行cml 蒸馏时,student 模型加载预训练模型,原始的日志是作者上面发的那些,改用2.3的 load_dygraph_params 加载 预训练模型,输出的日志是下面的这些,new_state_dict 大约匹配84个key。 这里 student 模型 是否加载预训练模型 区别大吗?

[2022/07/17 14:08:07] ppocr INFO: Architecture : 
[2022/07/17 14:08:07] ppocr INFO:     Models : 
[2022/07/17 14:08:07] ppocr INFO:         Student : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 disable_se : True
[2022/07/17 14:08:07] ppocr INFO:                 model_name : large
[2022/07/17 14:08:07] ppocr INFO:                 name : MobileNetV3
[2022/07/17 14:08:07] ppocr INFO:                 scale : 0.5
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : RSEFPN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 96
[2022/07/17 14:08:07] ppocr INFO:                 shortcut : True
[2022/07/17 14:08:07] ppocr INFO:             Transform : None
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/pretrained/MobileNetV3_large_x0_5_pretrained
[2022/07/17 14:08:07] ppocr INFO:         Student2 : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 disable_se : True
[2022/07/17 14:08:07] ppocr INFO:                 model_name : large
[2022/07/17 14:08:07] ppocr INFO:                 name : MobileNetV3
[2022/07/17 14:08:07] ppocr INFO:                 scale : 0.5
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : RSEFPN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 96
[2022/07/17 14:08:07] ppocr INFO:                 shortcut : True
[2022/07/17 14:08:07] ppocr INFO:             Transform : None
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/pretrained/MobileNetV3_large_x0_5_pretrained
[2022/07/17 14:08:07] ppocr INFO:         Teacher : 
[2022/07/17 14:08:07] ppocr INFO:             Backbone : 
[2022/07/17 14:08:07] ppocr INFO:                 in_channels : 3
[2022/07/17 14:08:07] ppocr INFO:                 layers : 50
[2022/07/17 14:08:07] ppocr INFO:                 name : ResNet
[2022/07/17 14:08:07] ppocr INFO:             Head : 
[2022/07/17 14:08:07] ppocr INFO:                 k : 50
[2022/07/17 14:08:07] ppocr INFO:                 kernel_list : [7, 2, 2]
[2022/07/17 14:08:07] ppocr INFO:                 name : DBHead
[2022/07/17 14:08:07] ppocr INFO:             Neck : 
[2022/07/17 14:08:07] ppocr INFO:                 name : LKPAN
[2022/07/17 14:08:07] ppocr INFO:                 out_channels : 224
[2022/07/17 14:08:07] ppocr INFO:             algorithm : DB
[2022/07/17 14:08:07] ppocr INFO:             freeze_params : True
[2022/07/17 14:08:07] ppocr INFO:             model_type : det
[2022/07/17 14:08:07] ppocr INFO:             pretrained : ./models/det/db_0629_v1/student
[2022/07/17 14:08:07] ppocr INFO:             return_all_feats : False
[2022/07/17 14:08:07] ppocr INFO:     algorithm : Distillation
[2022/07/17 14:08:07] ppocr INFO:     model_type : det
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationModel
[2022/07/17 14:08:07] ppocr INFO: Eval : 
[2022/07/17 14:08:07] ppocr INFO:     dataset : 
[2022/07/17 14:08:07] ppocr INFO:         data_dir : None
[2022/07/17 14:08:07] ppocr INFO:         label_file_list : ['custom/data/det_word_0421_val.txt']
[2022/07/17 14:08:07] ppocr INFO:         name : SimpleDataSet
[2022/07/17 14:08:07] ppocr INFO:         transforms : 
[2022/07/17 14:08:07] ppocr INFO:             DecodeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 channel_first : False
[2022/07/17 14:08:07] ppocr INFO:                 img_mode : BGR
[2022/07/17 14:08:07] ppocr INFO:             DetLabelEncode : None
[2022/07/17 14:08:07] ppocr INFO:             DetResizeForTest : None
[2022/07/17 14:08:07] ppocr INFO:             NormalizeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 mean : [0.485, 0.456, 0.406]
[2022/07/17 14:08:07] ppocr INFO:                 order : hwc
[2022/07/17 14:08:07] ppocr INFO:                 scale : 1./255.
[2022/07/17 14:08:07] ppocr INFO:                 std : [0.229, 0.224, 0.225]
[2022/07/17 14:08:07] ppocr INFO:             ToCHWImage : None
[2022/07/17 14:08:07] ppocr INFO:             KeepKeys : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_keys : ['image', 'shape', 'polys', 'ignore_tags']
[2022/07/17 14:08:07] ppocr INFO:     loader : 
[2022/07/17 14:08:07] ppocr INFO:         batch_size_per_card : 1
[2022/07/17 14:08:07] ppocr INFO:         drop_last : False
[2022/07/17 14:08:07] ppocr INFO:         num_workers : 1
[2022/07/17 14:08:07] ppocr INFO:         shuffle : False
[2022/07/17 14:08:07] ppocr INFO:         use_shared_memory : False
[2022/07/17 14:08:07] ppocr INFO: Global : 
[2022/07/17 14:08:07] ppocr INFO:     cal_metric_during_train : False
[2022/07/17 14:08:07] ppocr INFO:     checkpoints : None
[2022/07/17 14:08:07] ppocr INFO:     debug : False
[2022/07/17 14:08:07] ppocr INFO:     distributed : False
[2022/07/17 14:08:07] ppocr INFO:     epoch_num : 500
[2022/07/17 14:08:07] ppocr INFO:     eval_batch_step : [0, 400]
[2022/07/17 14:08:07] ppocr INFO:     infer_img : doc/imgs_en/img_10.jpg
[2022/07/17 14:08:07] ppocr INFO:     log_smooth_window : 20
[2022/07/17 14:08:07] ppocr INFO:     pretrained_model : None
[2022/07/17 14:08:07] ppocr INFO:     print_batch_step : 10
[2022/07/17 14:08:07] ppocr INFO:     save_epoch_step : 100
[2022/07/17 14:08:07] ppocr INFO:     save_inference_dir : None
[2022/07/17 14:08:07] ppocr INFO:     save_model_dir : ./models/det/db_test/
[2022/07/17 14:08:07] ppocr INFO:     save_res_path : ./checkpoints/det_db/predicts_db.txt
[2022/07/17 14:08:07] ppocr INFO:     use_gpu : False
[2022/07/17 14:08:07] ppocr INFO:     use_visualdl : False
[2022/07/17 14:08:07] ppocr INFO: Loss : 
[2022/07/17 14:08:07] ppocr INFO:     loss_config_list : 
[2022/07/17 14:08:07] ppocr INFO:         DistillationDilaDBLoss : 
[2022/07/17 14:08:07] ppocr INFO:             alpha : 5
[2022/07/17 14:08:07] ppocr INFO:             balance_loss : True
[2022/07/17 14:08:07] ppocr INFO:             beta : 10
[2022/07/17 14:08:07] ppocr INFO:             key : maps
[2022/07/17 14:08:07] ppocr INFO:             main_loss_type : DiceLoss
[2022/07/17 14:08:07] ppocr INFO:             model_name_pairs : [['Student', 'Teacher'], ['Student2', 'Teacher']]
[2022/07/17 14:08:07] ppocr INFO:             ohem_ratio : 3
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:         DistillationDMLLoss : 
[2022/07/17 14:08:07] ppocr INFO:             key : maps
[2022/07/17 14:08:07] ppocr INFO:             maps_name : thrink_maps
[2022/07/17 14:08:07] ppocr INFO:             model_name_pairs : ['Student', 'Student2']
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:         DistillationDBLoss : 
[2022/07/17 14:08:07] ppocr INFO:             alpha : 5
[2022/07/17 14:08:07] ppocr INFO:             balance_loss : True
[2022/07/17 14:08:07] ppocr INFO:             beta : 10
[2022/07/17 14:08:07] ppocr INFO:             main_loss_type : DiceLoss
[2022/07/17 14:08:07] ppocr INFO:             model_name_list : ['Student', 'Student2']
[2022/07/17 14:08:07] ppocr INFO:             ohem_ratio : 3
[2022/07/17 14:08:07] ppocr INFO:             weight : 1.0
[2022/07/17 14:08:07] ppocr INFO:     name : CombinedLoss
[2022/07/17 14:08:07] ppocr INFO: Metric : 
[2022/07/17 14:08:07] ppocr INFO:     base_metric_name : DetMetric
[2022/07/17 14:08:07] ppocr INFO:     key : Student
[2022/07/17 14:08:07] ppocr INFO:     main_indicator : hmean
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationMetric
[2022/07/17 14:08:07] ppocr INFO: Optimizer : 
[2022/07/17 14:08:07] ppocr INFO:     beta1 : 0.9
[2022/07/17 14:08:07] ppocr INFO:     beta2 : 0.999
[2022/07/17 14:08:07] ppocr INFO:     lr : 
[2022/07/17 14:08:07] ppocr INFO:         learning_rate : 0.001
[2022/07/17 14:08:07] ppocr INFO:         name : Cosine
[2022/07/17 14:08:07] ppocr INFO:         warmup_epoch : 2
[2022/07/17 14:08:07] ppocr INFO:     name : Adam
[2022/07/17 14:08:07] ppocr INFO:     regularizer : 
[2022/07/17 14:08:07] ppocr INFO:         factor : 5e-05
[2022/07/17 14:08:07] ppocr INFO:         name : L2
[2022/07/17 14:08:07] ppocr INFO: PostProcess : 
[2022/07/17 14:08:07] ppocr INFO:     box_thresh : 0.6
[2022/07/17 14:08:07] ppocr INFO:     key : head_out
[2022/07/17 14:08:07] ppocr INFO:     max_candidates : 1000
[2022/07/17 14:08:07] ppocr INFO:     model_name : ['Student']
[2022/07/17 14:08:07] ppocr INFO:     name : DistillationDBPostProcess
[2022/07/17 14:08:07] ppocr INFO:     thresh : 0.3
[2022/07/17 14:08:07] ppocr INFO:     unclip_ratio : 1.5
[2022/07/17 14:08:07] ppocr INFO: Train : 
[2022/07/17 14:08:07] ppocr INFO:     dataset : 
[2022/07/17 14:08:07] ppocr INFO:         data_dir : None
[2022/07/17 14:08:07] ppocr INFO:         label_file_list : ['custom/data/det_word_0421_train.txt']
[2022/07/17 14:08:07] ppocr INFO:         name : SimpleDataSet
[2022/07/17 14:08:07] ppocr INFO:         ratio_list : [1.0]
[2022/07/17 14:08:07] ppocr INFO:         transforms : 
[2022/07/17 14:08:07] ppocr INFO:             DecodeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 channel_first : False
[2022/07/17 14:08:07] ppocr INFO:                 img_mode : BGR
[2022/07/17 14:08:07] ppocr INFO:             DetLabelEncode : None
[2022/07/17 14:08:07] ppocr INFO:             CopyPaste : None
[2022/07/17 14:08:07] ppocr INFO:             IaaAugment : 
[2022/07/17 14:08:07] ppocr INFO:                 augmenter_args : 
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         p : 0.5
[2022/07/17 14:08:07] ppocr INFO:                     type : Fliplr
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         rotate : [-10, 10]
[2022/07/17 14:08:07] ppocr INFO:                     type : Affine
[2022/07/17 14:08:07] ppocr INFO:                     args : 
[2022/07/17 14:08:07] ppocr INFO:                         size : [0.5, 3]
[2022/07/17 14:08:07] ppocr INFO:                     type : Resize
[2022/07/17 14:08:07] ppocr INFO:             EastRandomCropData : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_ratio : True
[2022/07/17 14:08:07] ppocr INFO:                 max_tries : 50
[2022/07/17 14:08:07] ppocr INFO:                 size : [640, 640]
[2022/07/17 14:08:07] ppocr INFO:             MakeBorderMap : 
[2022/07/17 14:08:07] ppocr INFO:                 shrink_ratio : 0.4
[2022/07/17 14:08:07] ppocr INFO:                 thresh_max : 0.7
[2022/07/17 14:08:07] ppocr INFO:                 thresh_min : 0.3
[2022/07/17 14:08:07] ppocr INFO:             MakeShrinkMap : 
[2022/07/17 14:08:07] ppocr INFO:                 min_text_size : 8
[2022/07/17 14:08:07] ppocr INFO:                 shrink_ratio : 0.4
[2022/07/17 14:08:07] ppocr INFO:             NormalizeImage : 
[2022/07/17 14:08:07] ppocr INFO:                 mean : [0.485, 0.456, 0.406]
[2022/07/17 14:08:07] ppocr INFO:                 order : hwc
[2022/07/17 14:08:07] ppocr INFO:                 scale : 1./255.
[2022/07/17 14:08:07] ppocr INFO:                 std : [0.229, 0.224, 0.225]
[2022/07/17 14:08:07] ppocr INFO:             ToCHWImage : None
[2022/07/17 14:08:07] ppocr INFO:             KeepKeys : 
[2022/07/17 14:08:07] ppocr INFO:                 keep_keys : ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask']
[2022/07/17 14:08:07] ppocr INFO:     loader : 
[2022/07/17 14:08:07] ppocr INFO:         batch_size_per_card : 4
[2022/07/17 14:08:07] ppocr INFO:         drop_last : False
[2022/07/17 14:08:07] ppocr INFO:         num_workers : 1
[2022/07/17 14:08:07] ppocr INFO:         shuffle : True
[2022/07/17 14:08:07] ppocr INFO:         use_shared_memory : False
[2022/07/17 14:08:07] ppocr INFO: profiler_options : None
[2022/07/17 14:08:07] ppocr INFO: train with paddle 2.1.2 and device CPUPlace
[2022/07/17 14:08:14] ppocr INFO: Initialize indexs of datasets:['custom/data/det_word_0421_train.txt']
[2022/07/17 14:08:14] ppocr INFO: Initialize indexs of datasets:['custom/data/det_word_0421_val.txt']
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.conv.weight [24, 40, 1, 1] not matched with loaded params conv5.mid_se.conv1.weight [10, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn.weight [24] not matched with loaded params conv5.mid_se.conv1.bias [10] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn.bias [24] not matched with loaded params conv5.mid_se.conv2.weight [40, 10, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn._mean [24] not matched with loaded params conv5.mid_se.conv2.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.0.linear_conv.bn._variance [24] not matched with loaded params conv5.linear_conv.conv.weight [24, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.conv.weight [64, 24, 1, 1] not matched with loaded params conv5.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn.weight [64] not matched with loaded params conv5.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn.bias [64] not matched with loaded params conv5.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn._mean [64] not matched with loaded params conv5.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.expand_conv.bn._variance [64] not matched with loaded params conv6.expand_conv.conv.weight [64, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.bottleneck_conv.conv.weight [64, 1, 5, 5] not matched with loaded params conv6.expand_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.bottleneck_conv.bn._variance [64] not matched with loaded params conv6.bottleneck_conv.conv.weight [64, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.conv.weight [24, 64, 1, 1] not matched with loaded params conv6.bottleneck_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn.weight [24] not matched with loaded params conv6.bottleneck_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn.bias [24] not matched with loaded params conv6.bottleneck_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn._mean [24] not matched with loaded params conv6.bottleneck_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.1.linear_conv.bn._variance [24] not matched with loaded params conv6.mid_se.conv1.weight [16, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.conv.weight [64, 24, 1, 1] not matched with loaded params conv6.mid_se.conv1.bias [16] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn.weight [64] not matched with loaded params conv6.mid_se.conv2.weight [64, 16, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn._mean [64] not matched with loaded params conv6.linear_conv.conv.weight [24, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.expand_conv.bn._variance [64] not matched with loaded params conv6.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.conv.weight [64, 1, 5, 5] not matched with loaded params conv6.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn.weight [64] not matched with loaded params conv6.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn.bias [64] not matched with loaded params conv6.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.bottleneck_conv.bn._mean [64] not matched with loaded params conv7.expand_conv.conv.weight [64, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.conv.weight [24, 64, 1, 1] not matched with loaded params conv7.expand_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn.weight [24] not matched with loaded params conv7.expand_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn.bias [24] not matched with loaded params conv7.expand_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn._mean [24] not matched with loaded params conv7.bottleneck_conv.conv.weight [64, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage1.2.linear_conv.bn._variance [24] not matched with loaded params conv7.bottleneck_conv.bn.weight [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.conv.weight [120, 24, 1, 1] not matched with loaded params conv7.bottleneck_conv.bn.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn.weight [120] not matched with loaded params conv7.bottleneck_conv.bn._mean [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn.bias [120] not matched with loaded params conv7.bottleneck_conv.bn._variance [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn._mean [120] not matched with loaded params conv7.mid_se.conv1.weight [16, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.expand_conv.bn._variance [120] not matched with loaded params conv7.mid_se.conv1.bias [16] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.conv.weight [120, 1, 3, 3] not matched with loaded params conv7.mid_se.conv2.weight [64, 16, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn.weight [120] not matched with loaded params conv7.mid_se.conv2.bias [64] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn.bias [120] not matched with loaded params conv7.linear_conv.conv.weight [24, 64, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn._mean [120] not matched with loaded params conv7.linear_conv.bn.weight [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.bottleneck_conv.bn._variance [120] not matched with loaded params conv7.linear_conv.bn.bias [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.conv.weight [40, 120, 1, 1] not matched with loaded params conv7.linear_conv.bn._mean [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn.weight [40] not matched with loaded params conv7.linear_conv.bn._variance [24] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn.bias [40] not matched with loaded params conv8.expand_conv.conv.weight [120, 24, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn._mean [40] not matched with loaded params conv8.expand_conv.bn.weight [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.0.linear_conv.bn._variance [40] not matched with loaded params conv8.expand_conv.bn.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.conv.weight [104, 40, 1, 1] not matched with loaded params conv8.expand_conv.bn._mean [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn.weight [104] not matched with loaded params conv8.expand_conv.bn._variance [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn.bias [104] not matched with loaded params conv8.bottleneck_conv.conv.weight [120, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn._mean [104] not matched with loaded params conv8.bottleneck_conv.bn.weight [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.expand_conv.bn._variance [104] not matched with loaded params conv8.bottleneck_conv.bn.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.conv.weight [104, 1, 3, 3] not matched with loaded params conv8.bottleneck_conv.bn._mean [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn.weight [104] not matched with loaded params conv8.bottleneck_conv.bn._variance [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn.bias [104] not matched with loaded params conv8.linear_conv.conv.weight [40, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn._mean [104] not matched with loaded params conv8.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.bottleneck_conv.bn._variance [104] not matched with loaded params conv8.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.conv.weight [40, 104, 1, 1] not matched with loaded params conv8.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn.bias [40] not matched with loaded params conv9.expand_conv.conv.weight [104, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn._mean [40] not matched with loaded params conv9.expand_conv.bn.weight [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.1.linear_conv.bn._variance [40] not matched with loaded params conv9.expand_conv.bn.bias [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.conv.weight [96, 40, 1, 1] not matched with loaded params conv9.expand_conv.bn._mean [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn.weight [96] not matched with loaded params conv9.expand_conv.bn._variance [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn.bias [96] not matched with loaded params conv9.bottleneck_conv.conv.weight [104, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn._mean [96] not matched with loaded params conv9.bottleneck_conv.bn.weight [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.expand_conv.bn._variance [96] not matched with loaded params conv9.bottleneck_conv.bn.bias [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.conv.weight [96, 1, 3, 3] not matched with loaded params conv9.bottleneck_conv.bn._mean [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn.weight [96] not matched with loaded params conv9.bottleneck_conv.bn._variance [104] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn.bias [96] not matched with loaded params conv9.linear_conv.conv.weight [40, 104, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn._mean [96] not matched with loaded params conv9.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.bottleneck_conv.bn._variance [96] not matched with loaded params conv9.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.conv.weight [40, 96, 1, 1] not matched with loaded params conv9.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn.bias [40] not matched with loaded params conv10.expand_conv.conv.weight [96, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn._mean [40] not matched with loaded params conv10.expand_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.2.linear_conv.bn._variance [40] not matched with loaded params conv10.expand_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.expand_conv.conv.weight [96, 40, 1, 1] not matched with loaded params conv10.expand_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.expand_conv.bn.bias [96] not matched with loaded params conv10.bottleneck_conv.conv.weight [96, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.conv.weight [96, 1, 3, 3] not matched with loaded params conv10.bottleneck_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn.bias [96] not matched with loaded params conv10.linear_conv.conv.weight [40, 96, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn._mean [96] not matched with loaded params conv10.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.bottleneck_conv.bn._variance [96] not matched with loaded params conv10.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.conv.weight [40, 96, 1, 1] not matched with loaded params conv10.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn.bias [40] not matched with loaded params conv11.expand_conv.conv.weight [96, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn._mean [40] not matched with loaded params conv11.expand_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.3.linear_conv.bn._variance [40] not matched with loaded params conv11.expand_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.conv.weight [240, 40, 1, 1] not matched with loaded params conv11.expand_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn.weight [240] not matched with loaded params conv11.expand_conv.bn._variance [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn.bias [240] not matched with loaded params conv11.bottleneck_conv.conv.weight [96, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn._mean [240] not matched with loaded params conv11.bottleneck_conv.bn.weight [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.expand_conv.bn._variance [240] not matched with loaded params conv11.bottleneck_conv.bn.bias [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.conv.weight [240, 1, 3, 3] not matched with loaded params conv11.bottleneck_conv.bn._mean [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn.weight [240] not matched with loaded params conv11.bottleneck_conv.bn._variance [96] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn.bias [240] not matched with loaded params conv11.linear_conv.conv.weight [40, 96, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn._mean [240] not matched with loaded params conv11.linear_conv.bn.weight [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.bottleneck_conv.bn._variance [240] not matched with loaded params conv11.linear_conv.bn.bias [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.conv.weight [56, 240, 1, 1] not matched with loaded params conv11.linear_conv.bn._mean [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn.weight [56] not matched with loaded params conv11.linear_conv.bn._variance [40] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn.bias [56] not matched with loaded params conv12.expand_conv.conv.weight [240, 40, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn._mean [56] not matched with loaded params conv12.expand_conv.bn.weight [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.4.linear_conv.bn._variance [56] not matched with loaded params conv12.expand_conv.bn.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.conv.weight [336, 56, 1, 1] not matched with loaded params conv12.expand_conv.bn._mean [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn.weight [336] not matched with loaded params conv12.expand_conv.bn._variance [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn.bias [336] not matched with loaded params conv12.bottleneck_conv.conv.weight [240, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn._mean [336] not matched with loaded params conv12.bottleneck_conv.bn.weight [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.expand_conv.bn._variance [336] not matched with loaded params conv12.bottleneck_conv.bn.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.conv.weight [336, 1, 3, 3] not matched with loaded params conv12.bottleneck_conv.bn._mean [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn.weight [336] not matched with loaded params conv12.bottleneck_conv.bn._variance [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn.bias [336] not matched with loaded params conv12.mid_se.conv1.weight [60, 240, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn._mean [336] not matched with loaded params conv12.mid_se.conv1.bias [60] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.bottleneck_conv.bn._variance [336] not matched with loaded params conv12.mid_se.conv2.weight [240, 60, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.linear_conv.conv.weight [56, 336, 1, 1] not matched with loaded params conv12.mid_se.conv2.bias [240] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage2.5.linear_conv.bn.weight [56] not matched with loaded params conv12.linear_conv.conv.weight [56, 240, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.expand_conv.conv.weight [336, 56, 1, 1] not matched with loaded params conv12.linear_conv.bn._variance [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.expand_conv.bn.weight [336] not matched with loaded params conv13.expand_conv.conv.weight [336, 56, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.bottleneck_conv.conv.weight [336, 1, 5, 5] not matched with loaded params conv13.expand_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.bottleneck_conv.bn.weight [336] not matched with loaded params conv13.bottleneck_conv.conv.weight [336, 1, 3, 3] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.conv.weight [80, 336, 1, 1] not matched with loaded params conv13.bottleneck_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn.weight [80] not matched with loaded params conv13.mid_se.conv1.weight [84, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn.bias [80] not matched with loaded params conv13.mid_se.conv1.bias [84] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn._mean [80] not matched with loaded params conv13.mid_se.conv2.weight [336, 84, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.0.linear_conv.bn._variance [80] not matched with loaded params conv13.mid_se.conv2.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.conv.weight [480, 80, 1, 1] not matched with loaded params conv13.linear_conv.conv.weight [56, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn.weight [480] not matched with loaded params conv13.linear_conv.bn.weight [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn.bias [480] not matched with loaded params conv13.linear_conv.bn.bias [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn._mean [480] not matched with loaded params conv13.linear_conv.bn._mean [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.expand_conv.bn._variance [480] not matched with loaded params conv13.linear_conv.bn._variance [56] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.conv.weight [480, 1, 5, 5] not matched with loaded params conv14.expand_conv.conv.weight [336, 56, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn.weight [480] not matched with loaded params conv14.expand_conv.bn.weight [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn.bias [480] not matched with loaded params conv14.expand_conv.bn.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn._mean [480] not matched with loaded params conv14.expand_conv.bn._mean [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.bottleneck_conv.bn._variance [480] not matched with loaded params conv14.expand_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.conv.weight [80, 480, 1, 1] not matched with loaded params conv14.bottleneck_conv.conv.weight [336, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn.weight [80] not matched with loaded params conv14.bottleneck_conv.bn.weight [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn.bias [80] not matched with loaded params conv14.bottleneck_conv.bn.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn._mean [80] not matched with loaded params conv14.bottleneck_conv.bn._mean [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.1.linear_conv.bn._variance [80] not matched with loaded params conv14.bottleneck_conv.bn._variance [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.conv.weight [480, 80, 1, 1] not matched with loaded params conv14.mid_se.conv1.weight [84, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn.weight [480] not matched with loaded params conv14.mid_se.conv1.bias [84] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn.bias [480] not matched with loaded params conv14.mid_se.conv2.weight [336, 84, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn._mean [480] not matched with loaded params conv14.mid_se.conv2.bias [336] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.expand_conv.bn._variance [480] not matched with loaded params conv14.linear_conv.conv.weight [80, 336, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.conv.weight [480, 1, 5, 5] not matched with loaded params conv14.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn.weight [480] not matched with loaded params conv14.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn.bias [480] not matched with loaded params conv14.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn._mean [480] not matched with loaded params conv14.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.bottleneck_conv.bn._variance [480] not matched with loaded params conv15.expand_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.conv.weight [80, 480, 1, 1] not matched with loaded params conv15.expand_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn.weight [80] not matched with loaded params conv15.expand_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn.bias [80] not matched with loaded params conv15.expand_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn._mean [80] not matched with loaded params conv15.expand_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.2.linear_conv.bn._variance [80] not matched with loaded params conv15.bottleneck_conv.conv.weight [480, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.3.conv.weight [480, 80, 1, 1] not matched with loaded params conv15.bottleneck_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params backbone.stage3.3.bn._variance [480] not matched with loaded params conv15.mid_se.conv1.weight [120, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.in_conv.weight [96, 16, 1, 1] not matched with loaded params conv15.mid_se.conv1.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv15.mid_se.conv2.weight [480, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv1.bias [24] not matched with loaded params conv15.mid_se.conv2.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv15.linear_conv.conv.weight [80, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.0.se_block.conv2.bias [96] not matched with loaded params conv15.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.in_conv.weight [96, 24, 1, 1] not matched with loaded params conv15.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv15.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv1.bias [24] not matched with loaded params conv15.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.expand_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.1.se_block.conv2.bias [96] not matched with loaded params conv16.expand_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.in_conv.weight [96, 56, 1, 1] not matched with loaded params conv16.expand_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv16.expand_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv1.bias [24] not matched with loaded params conv16.expand_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.bottleneck_conv.conv.weight [480, 1, 5, 5] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.2.se_block.conv2.bias [96] not matched with loaded params conv16.bottleneck_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.in_conv.weight [96, 480, 1, 1] not matched with loaded params conv16.bottleneck_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv1.weight [24, 96, 1, 1] not matched with loaded params conv16.bottleneck_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv1.bias [24] not matched with loaded params conv16.bottleneck_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv2.weight [96, 24, 1, 1] not matched with loaded params conv16.mid_se.conv1.weight [120, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.ins_conv.3.se_block.conv2.bias [96] not matched with loaded params conv16.mid_se.conv1.bias [120] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.in_conv.weight [24, 96, 3, 3] not matched with loaded params conv16.mid_se.conv2.weight [480, 120, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params conv16.mid_se.conv2.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv1.bias [6] not matched with loaded params conv16.linear_conv.conv.weight [80, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params conv16.linear_conv.bn.weight [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.0.se_block.conv2.bias [24] not matched with loaded params conv16.linear_conv.bn.bias [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.in_conv.weight [24, 96, 3, 3] not matched with loaded params conv16.linear_conv.bn._mean [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params conv16.linear_conv.bn._variance [80] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv1.bias [6] not matched with loaded params last_second_conv.conv.weight [480, 80, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params last_second_conv.bn.weight [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.1.se_block.conv2.bias [24] not matched with loaded params last_second_conv.bn.bias [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.in_conv.weight [24, 96, 3, 3] not matched with loaded params last_second_conv.bn._mean [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv1.weight [6, 24, 1, 1] not matched with loaded params last_second_conv.bn._variance [480] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv1.bias [6] not matched with loaded params last_conv.weight [1280, 480, 1, 1] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv2.weight [24, 6, 1, 1] not matched with loaded params out.weight [1280, 1000] !
[2022/07/17 14:08:41] ppocr INFO: The shape of model params neck.inp_conv.2.se_block.conv2.bias [24] not matched with loaded params out.bias [1000] !

Originally posted by @Zhang-O in #6684 (comment)

2.3 和 2.5 都用,目前蒸馏DBnet 用2.5

请问下2.5加载预训练模型参数报这种错误要怎么解决呢

Zhang-O commented 2 years ago

你要么就不要用预训练模型了,要么就在2.5分支的代码中,在加载预训练模型的地方,使用2.3的 load_dygraph_params的逻辑改成 load_pretrained_params_v1,而不是使用原来的load_pretrained_params

def load_pretrained_params_v1(model, path):

    logger = get_logger()
    logger.info(f"using load_pretrained_params_v1")
    if path.endswith('.pdparams'):
        path = path.replace('.pdparams', '')
    assert os.path.exists(path + ".pdparams"), \
        "The {}.pdparams does not exists!".format(path)

    params = paddle.load(path + '.pdparams')
    state_dict = model.state_dict()
    new_state_dict = {}
    for k1, k2 in zip(state_dict.keys(), params.keys()):
        if list(state_dict[k1].shape) == list(params[k2].shape):
            new_state_dict[k1] = params[k2]
        else:
            logger.info(
                f"The shape of model params {k1} {state_dict[k1].shape} not matched with loaded params {k2} {params[k2].shape} !"
            )
    logger.info("loaded keys / all keys(of pretrained model):  {} / {}".format(len(new_state_dict), len(params)))
    model.set_state_dict(new_state_dict)
    logger.info(f"loaded pretrained_model successful from {path}")
    return model
Akumio commented 2 years ago

[2022/07/28 17:36:34] ppocr INFO: using load_pretrained_params_v1 [2022/07/28 17:36:34] ppocr INFO: The shape of model params neck.encoder.lstm.weight_ih_l0 [1024, 512] not matched with loaded params out.weight [512, 1000] ! [2022/07/28 17:36:34] ppocr INFO: The shape of model params neck.encoder.lstm.weight_hh_l0 [1024, 256] not matched with loaded params out.bias [1000] ! [2022/07/28 17:36:34] ppocr INFO: loaded keys / all keys(of pretrained model): 195 / 197

请问下像这样有部分层参数不匹配会有影响吗

Zhang-O commented 2 years ago

应该没有问题,加载预训练模型一般都会有一部分layers 不匹配,是正常的。 我一开始还以为你是 PaddleOCR 官方人员。 你对Padddle熟悉吗?

Akumio commented 2 years ago

最近在尝试用paddleocr做项目,刚接触不久,感谢您的指导Thanks♪(・ω・)ノ

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleOCR" @.>; 发送时间: 2022年7月28日(星期四) 下午5:54 @.>; @.>;"State @.>; 主题: Re: [PaddlePaddle/PaddleOCR] > 你用的代码分支是? (Issue #7029)

应该没有问题,加载预训练模型一般都会有一部分layers 不匹配,是正常的。 我一开始还以为你是 PaddleOCR 官方人员。 你对Padddle熟悉吗?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

ankangGood commented 3 months ago

: train with paddle 2.5.0 and device Place(gpu:0) [2024/08/17 21:17:54] ppocr INFO: Initialize indexs of datasets:['./train_data/rec/train.txt'] list index out of range [2024/08/17 21:17:54] ppocr INFO: Initialize indexs of datasets:['./train_data/rec/val.txt'] W0817 21:17:54.120023 22840 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.8, Runtime API Version: 11.2 W0817 21:17:54.123973 22840 gpu_resources.cc:149] device: 0, cuDNN Version: 8.9. [2024/08/17 21:17:55] ppocr INFO: train dataloader has 3 iters [2024/08/17 21:17:55] ppocr INFO: valid dataloader has 1 iters [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_1._conv.weight not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_1._batch_norm.weight not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_1._batch_norm.bias not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_1._batch_norm._mean not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_1._batch_norm._variance not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_2._conv.weight not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_2._batch_norm.weight not in model [2024/08/17 21:17:57] ppocr WARNING: The pretrained params backbone.conv1_2._batch_norm.bias not in model 请问使用2.7的报这个错误 咋解决哈