PaddleOCR推理的pytorch实现和模型转换

Overview

PaddleOCR2Pytorch

简介

”真·白嫖“PaddleOCR

注意

PytorchOCRPaddleOCR-2.0rc1+动态图版本移植。

特性

高质量推理模型,准确的识别效果

  • 超轻量ptocr_mobile移动端系列
  • 通用ptocr_server系列
  • 支持中英文数字组合识别、竖排文本识别、长文本识别

模型列表

.pth模型下载链接:https://pan.baidu.com/s/1r1DELT8BlgxeOP2RqREJEg 提取码:6clx

检测模型

模型名称 PaddleOCR对应模型
ch_ptocr_mobile_v2.0_det_infer.pth ch_ppocr_mobile_v2.0_det: 推理模型 / 训练模型
ch_ptocr_server_v2.0_det_infer.pth ch_ppocr_server_v2.0_det: 推理模型 / 训练模型

识别模型

模型名称 PaddleOCR对应模型
ch_ptocr_mobile_v2.0_rec_infer.pth ch_ppocr_mobile_v2.0_rec: 推理模型 / 训练模型
ch_ptocr_server_v2.0_rec_infer.pth ch_ppocr_server_v2.0_rec: 推理模型 / 训练模型

分类模型

模型名称 PaddleOCR对应模型
ch_ptocr_mobile_v2.0_cls_infer.pth 推理模型 / 训练模型

效果展示

  • 中文模型

Pipeline

PP-OCR是一个实用的超轻量OCR系统。主要由DB文本检测、检测框矫正和CRNN文本识别三部分组成。该系统从骨干网络选择和调整、预测头部的设计、数据增强、学习率变换策略、正则化参数选择、预训练模型使用以及模型自动裁剪量化8个方面,采用19个有效策略,对各个模块的模型进行效果调优和瘦身,最终得到整体大小为3.5M的超轻量中英文OCR和2.8M的英文数字OCR。更多细节请参考PP-OCR技术方案 https://arxiv.org/abs/2009.09941 。其中FPGM裁剪器和PACT量化的实现可以参考PaddleSlim

推理

环境

shapely
numpy
pillow
pyclipper
opencv-python <= 4.2.0.32
pytorch

中文检测模型推理

python3 ./tools/infer/predict_det.py --image_dir ./doc/imgs --model_path your_det_pth_path.pth

中文识别模型推理

python3 ./tools/infer/predict_rec.py --image_dir ./doc/imgs_words --model_path your_rec_pth_path.pth

中文方向分类模型推理

python3 ./tools/infer/predict_cls.py --image_dir ./doc/imgs_words --model_path your_cls_pth_path.pth

文本检测、方向分类和文字识别串联推理

使用方向分类器

python3 ./tools/infer/predict_system.py --image_dir ./doc/imgs --det_model_path your_det_pth_path.pth --rec_model_path your_rec_pth_path.pth --use_angle_cls --cls_model_path your_cls_pth_path.pth

不适用方向分类器

python3 ./tools/infer/predict_system.py --image_dir ./doc/imgs --det_model_path your_det_pth_path.pth --rec_model_path your_rec_pth_path.pth

PaddleOCR2Pytorch

环境

shapely
numpy
pillow
pyclipper
opencv-python <= 4.2.0.32
pytorch
paddlepaddle==2.0rc1

模型转换

转换模型使用PaddleOCR的训练模型

模型路径详见PaddleOCR对应模型或者百度网盘链接https://pan.baidu.com/s/1getAprT2l_JqwhjwML0g9g 提取码:lmv7

python3 ./converter/ch_ppocr_mobile_v2.0_det_converter.py --src_model_path paddle_ch_ppocr_mobile_v2.0_det_train_dir

python3 ./converter/ch_ppocr_server_v2.0_det_converter.py --src_model_path paddle_ch_ppocr_server_v2.0_det_train_dir

python3 ./converter/ch_ppocr_mobile_v2.0_rec_converter.py --src_model_path paddle_ch_ppocr_mobile_v2.0_rec_train_dir

python3 ./converter/ch_ppocr_server_v2.0_rec_converter.py --src_model_path paddle_ch_ppocr_server_v2.0_rec_train_dir

python3 ./converter/ch_ppocr_mobile_v2.0_cls_converter.py --src_model_path paddle_ch_ppocr_mobile_v2.0_cls_train_dir

FAQ

参考

Comments
  • TPS and Transform support using PyTorch Code

    TPS and Transform support using PyTorch Code

    @frotms, I tried the Paddle code for conversion of TPS based models, the model gets converted but causes problems during the inference. Can you add support for TPS based models conversion using PyTorch?

    opened by kunaljain0 7
  • KeyError: 'backbone.conv.conv.weight'

    KeyError: 'backbone.conv.conv.weight'

    python ./converter/ch_ppocr_mobile_v2.0_det_converter.py --src_model_path ./ch_ppocr_mobile_v2.0_det_infer/
    {'k': 50, 'in_channels': 96}
    paddle weights loading...
    Traceback (most recent call last):
      File "./converter/ch_ppocr_mobile_v2.0_det_converter.py", line 61, in <module>
        converter = MobileV20DetConverter(cfg, paddle_pretrained_model_path)
      File "./converter/ch_ppocr_mobile_v2.0_det_converter.py", line 13, in __init__
        self.load_paddle_weights(paddle_pretrained_model_path)
      File "./converter/ch_ppocr_mobile_v2.0_det_converter.py", line 43, in load_paddle_weights
        self.net.state_dict()[k].copy_(torch.Tensor(para_state_dict[ppname]))
    KeyError: 'backbone.conv.conv.weight'
    
    opened by seekingdeep 7
  • Large difference between reported PaddleOCR performance and converted PyTorch model performance

    Large difference between reported PaddleOCR performance and converted PyTorch model performance

    Hi, thanks for releasing this nice converter, it's been very useful! I'm trying to benchmark the performance of PaddleOCR model and the corresponding converted PyTorch model on ICDAR2015 dataset and found there is a big gap between them that I couldn't explain, can you help me?

    The model I'm using is det_r50_vd_db_v2.0_train and the corresponding PyTorch model is det_r50_vd_db_v2.0_infer.pth.

    The reported performance for DB ResNet50_vd is precision: 86.41%, recall: 78.72%, hmean 82.38%.

    However, the best performance I can get from the converted model so far is precision: 66.51%, recall: 69.14%, hmean: 67.80%. The metric is calculated using the PaddleOCR's DetMetric class and I've matched exactly the same preprocessing and post-processing pipelines. I also excluded those bounding boxes which have ### as labels as done in the PaddleOCR data preparation.

    I've also searched issues in PaddleOCR and see if others experienced performance degradation and adjust some inference parameters such as using image_shape as the same as in the training configuration file.

    Do you have an idea what's going on in my case? Am I missing something? I would love to have your advice.

    Yuhuang.

    opened by duguyue100 4
  • 转换pt模型报错

    转换pt模型报错

    python ./converter/ch_ppocr_v2_rec_converter.py --src_model_path ./ch_PP-OCRv2_rec_train 文件路径:ch_PP-OCRv2_rec_train/best_accuracy/.pdopt、.pdparams、**.states 完整报错如下: W1223 17:12:03.727869 23403 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.0, Runtime API Version: 10.2 W1223 17:12:03.732515 23403 device_context.cc:422] device: 0, cuDNN Version: 8.0. Traceback (most recent call last): File "./converter/ch_ppocr_v2_rec_converter.py", line 80, in converter = PPOCRv2RecConverter(cfg, paddle_pretrained_model_path) File "./converter/ch_ppocr_v2_rec_converter.py", line 12, in init para_state_dict, opti_state_dict = self.read_paddle_weights(paddle_pretrained_model_path) File "/data/cxchen/PaddleOCR2Pytorch/pytorchocr/base_ocr_v20.py", line 94, in read_paddle_weights para_state_dict, opti_state_dict = fluid.load_dygraph(weights_path) File "/data/cxchen/venv/lib/python3.6/site-packages/paddle/fluid/dygraph/checkpoint.py", line 290, in load_dygraph attrs={'file_path': os.path.join(model_path, name)}) File "/data/cxchen/venv/lib/python3.6/site-packages/paddle/fluid/dygraph/tracer.py", line 45, in trace_op not stop_gradient) ValueError: (InvalidArgument) Deserialize to tensor failed, maybe the loaded file is not a paddle model(expected file format: 0, but 1904018048 found). [Hint: Expected version == 0U, but received version:1904018048 != 0U:0.] (at /paddle/paddle/fluid/framework/lod_tensor.cc:329) [operator < load > error]

    opened by DrewdropLife 4
  • 使用预训练模型出现 KeyError: 'neck.in2_conv.weight'

    使用预训练模型出现 KeyError: 'neck.in2_conv.weight'

    使用的模型结构是 ./configs/det/det_r50_vd_db.yml ,使用的paddle参数文件下载自 https://paddleocr.bj.bcebos.com/pretrained/ResNet50_vd_ssld_pretrained.pdparams 但是在尝试模型转换时出现了如下报错 Traceback (most recent call last): File "../converter/det_converter.py", line 94, in converter = DetV20DetConverter(cfg, paddle_pretrained_model_path, **kwargs) File "../converter/det_converter.py", line 12, in init self.load_paddle_weights(paddle_pretrained_model_path) File "../converter/det_converter.py", line 56, in load_paddle_weights self.net.state_dict()[k].copy_(torch.Tensor(para_state_dict[ppname])) KeyError: 'neck.in2_conv.weight' 原本猜测是模型不对,想要从给的百度网盘中找合适的模型参数文件,但是本项目中提到的网盘链接(https://pan.baidu.com/s/1getAprT2l_JqwhjwML0g9g 提取码:lmv7)已经失效。

    opened by SouthIO 3
  • paddleocr trained model to pytorch pth.

    paddleocr trained model to pytorch pth.

    Hello, thank you for your work. I trained SRN mudule in PaddleOCR on my dataset. i convert the trained model into inference and onnxt format. How can i convert trained model to pytorch pth file. Thank you

    opened by Ehteshamciitwah 3
  • ppocr-v3中文识别模型预测结果与paddle的不一致

    ppocr-v3中文识别模型预测结果与paddle的不一致

    请问下对pytorch版本有要求吗?我使用ch_ptocr_v3_rec_infer.pth的识别结果:

    python ./tools/infer/predict_rec.py --rec_algorithm SVTR --rec_model_path ./ch_ptocr_v3_rec_infer.pth --rec_image_shape 3,48,320 --image_dir test.jpg
    
    ('注室你的以发一夜七发使用4突击步检命中头部海淡了', 0.74806666)
    

    以下是paddleocr的识别结果:

    paddleocr --image_dir  test.jpg --det false
    
    ('主室你的队友一液七次i使用AKM突击步枪命中头部淘汰了', 0.9387470483779907)
    

    test

    opened by zhiweizhong 2
  • 转换模型问题: list index out of range

    转换模型问题: list index out of range

    想把 paddle 的rec模型转化为pytorch. 遇到点问题

    python3 ch_ppocr_v3_rec_converter.py --src_model_path ...../libs/paddle/paddle_ocr_module/ch_PP-OCRv3_rec_infer

    Traceback (most recent call last):
      File "ch_ppocr_v3_rec_converter.py", line 93, in <module>
        converter = PPOCRv3RecConverter(cfg, paddle_pretrained_model_path)
      File "ch_ppocr_v3_rec_converter.py", line 14, in __init__
        out_channels = list(para_state_dict.values())[-1].shape[0]
    IndexError: list index out of range
    
    

    看起来像是模型不对,解压后模型文件inference.info, inference.pdiparams, inference.pdmodel 都放在 ch_PP-OCRv3_rec_infer目录下。我这是哪里不对?

    opened by LightSun 2
  • 使用SRN识别模型出错

    使用SRN识别模型出错

    使用SRN模型识别时,在rec_postprocess.py文件报错: 2022_05_27_16_37_11 看起来是字典不对?我用的是ppocr_keys_v1.txt这个字典。 附rec参数:

    params for text recognizer

    parser.add_argument("--rec_algorithm", type=str, default='SRN')
    parser.add_argument("--rec_model_path", type=str, default='./weights/rec_r50_vd_srn_infer.pth')
    parser.add_argument("--rec_image_shape", type=str, default="1, 64, 256")
    parser.add_argument("--rec_char_type", type=str, default='en')
    parser.add_argument("--rec_batch_num", type=int, default=6)
    parser.add_argument("--max_text_length", type=int, default=25)
    

    parser.add_argument("--use_space_char", type=str2bool, default=True) parser.add_argument("--drop_score", type=float, default=0.5) parser.add_argument("--limited_max_width", type=int, default=1280) parser.add_argument("--limited_min_width", type=int, default=16)

    parser.add_argument(
        "--vis_font_path", type=str,
        default=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'doc/fonts/simfang.ttf'))
    parser.add_argument(
        "--rec_char_dict_path",
        type=str,
        default=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
                             'pytorchocr/utils/ppocr_keys_v1.txt'))
    

    params .yaml

    parser.add_argument("--det_yaml_path", type=str, default=None)
    parser.add_argument("--rec_yaml_path", type=str, default="./configs/rec/rec_r50_fpn_srn.yml")
    parser.add_argument("--cls_yaml_path", type=str, default=None)
    parser.add_argument("--e2e_yaml_path", type=str, default=None)
    
    opened by loveq007 2
  • GRUCell模块转写bias问题

    GRUCell模块转写bias问题

    • 感谢作者的工作,正好看到一个小问题

    • 下面是作者转写的,其中bias=True https://github.com/frotms/PaddleOCR2Pytorch/blob/28ac1197325dff63f084b845fe82b92cab04e921/pytorchocr/modeling/heads/rec_att_head.py#L76-L77

    • Paddle系列写法源码

            self.rnn = nn.GRUCell(input_size=input_size + num_embeddings, hidden_size=hidden_size)
    
    • 经过查各自API,发现Paddle中的GRUCellbias默认为None,作者转写对应GRUCell设置为bias=True
    • 不知是您笔误,还是有其他用法
    opened by SWHL 2
  • KeyError: 'Student.backbone.conv1._conv.weight

    KeyError: 'Student.backbone.conv1._conv.weight

    运行ch_ppocr_v2_rec_converter.py 出现

    Traceback (most recent call last):
      File "/home/user/paddle/PaddleOCR2Pytorch/converter/ch_ppocr_v2_rec_converter.py", line 56, in load_paddle_weights
        self.net.state_dict()[k].copy_(torch.Tensor(para_state_dict[ppname]))
    KeyError: 'Student.backbone.conv1._conv.weight'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/user/paddle/PaddleOCR2Pytorch/converter/ch_ppocr_v2_rec_converter.py", line 80, in <module>
        converter = PPOCRv2RecConverter(cfg, paddle_pretrained_model_path)
      File "/home/user/paddle/PaddleOCR2Pytorch/converter/ch_ppocr_v2_rec_converter.py", line 19, in __init__
        self.load_paddle_weights([para_state_dict, opti_state_dict])
      File "/home/user/paddle/PaddleOCR2Pytorch/converter/ch_ppocr_v2_rec_converter.py", line 60, in load_paddle_weights
        print('paddle: {}, {}'.format(ppname, para_state_dict[ppname].shape))
    KeyError: 'Student.backbone.conv1._conv.weight'
    

    paddle 模型:ch_ppocr_server_v2.0_rec_pre

    opened by phybrain 0
  • python ./tools/infer/predict_det.py --det_algorithm DB --det_model_path  ./weight/en_ptocr_v3_det_infer.pth --i mage_dir ./doc/imgs/1.jpg推理错误

    python ./tools/infer/predict_det.py --det_algorithm DB --det_model_path ./weight/en_ptocr_v3_det_infer.pth --i mage_dir ./doc/imgs/1.jpg推理错误

    请问在使用百度网盘提供的权重进行推理时出现权重加载不进去是什么原因? {'fc_decay': 4e-05, 'in_channels': 96} Traceback (most recent call last): File "./tools/infer/predict_det.py", line 233, in text_detector = TextDetector(args) File "./tools/infer/predict_det.py", line 111, in init self.load_pytorch_weights(self.weights_path) File "F:\42_ZhuanPaddle\PaddleOCR2Pytorch-main\pytorchocr\base_ocr_v20.py", line 77, in load_pytorch_weights self.net.load_state_dict(torch.load(weights_path)) File "G:\Compiler\Anaconda2021.11\envs\cu102_torch110_py38_paddleocr\lib\site-packages\torch\nn\modules\module.py", line 1482, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for BaseModel: Missing key(s) in state_dict: "backbone.conv1.conv.weight", "backbone.conv1.bn.weight", "backbone.conv1.bn.bias", "backbone.conv1.bn.running_mean", "backbone.conv1.bn.running_v ar", "backbone.blocks.0.expand_conv.conv.weight", "backbone.blocks.0.expand_conv.bn.weight", "backbone.blocks.0.expand_conv.bn.bias", "backbone.blocks.0.expand_conv.bn.running_mean", " backbone.blocks.0.expand_conv.bn.running_var", "backbone.blocks.0.bottleneck_conv.conv.weight", "backbone.blocks.0.bottleneck_conv.bn.weight", "backbone.blocks.0.bottleneck_conv.bn.bia s", "backbone.blocks.0.bottleneck_conv.bn.running_mean", "backbone.blocks.0.bottleneck_conv.bn.running_var", "backbone.blocks.0.mid_se.conv1.weight", "backbone.blocks.0.mid_se.conv1.bi as", "backbone.blocks.0.mid_se.conv2.weight", "backbone.blocks.0.mid_se.conv2.bias", "backbone.blocks.0.linear_conv.conv.weight", "backbone.blocks.0.linear_conv.bn.weight", "backbone.b locks.0.linear_conv.bn.bias", "backbone.blocks.0.linear_conv.bn.running_mean", "backbone.blocks.0.linear_conv.bn.running_var", "backbone.blocks.1.expand_conv.conv.weight", "backbone.bl ocks.1.expand_conv.bn.weight", "backbone.blocks.1.expand_conv.bn.bias", "backbone.blocks.1.expand_conv.bn.running_mean", "backbone.blocks.1.expand_conv.bn.running_var", "backbone.block s.1.bottleneck_conv.conv.weight", "backbone.blocks.1.bottleneck_conv.bn.weight", "backbone.blocks.1.bottleneck_conv.bn.bias", "backbone.blocks.1.bottleneck_conv.bn.running_mean", "back bone.blocks.1.bottleneck_conv.bn.running_var", "backbone.blocks.1.linear_conv.conv.weight", "backbone.blocks.1.linear_conv.bn.weight", "backbone.blocks.1.linear_conv.bn.bias", "backbon e.blocks.1.linear_conv.bn.running_mean", "backbone.blocks.1.linear_conv.bn.running_var", "backbone.blocks.2.expand_conv.conv.weight", "backbone.blocks.2.expand_conv.bn.weight", "backbo ne.blocks.2.expand_conv.bn.bias", "backbone.blocks.2.expand_conv.bn.running_mean", "backbone.blocks.2.expand_conv.bn.running_var", "backbone.blocks.2.bottleneck_conv.conv.weight", "bac kbone.blocks.2.bottleneck_conv.bn.weight", "backbone.blocks.2.bottleneck_conv.bn.bias", "backbone.blocks.2.bottleneck_conv.bn.running_mean", "backbone.blocks.2.bottleneck_conv.bn.runni ng_var", "backbone.blocks.2.linear_conv.conv.weight", "backbone.blocks.2.linear_conv.bn.weight", "backbone.blocks.2.linear_conv.bn.bias", "backbone.blocks.2.linear_conv.bn.running_mean ", "backbone.blocks.2.linear_conv.bn.running_var", "backbone.blocks.3.expand_conv.conv.weight", "backbone.blocks.3.expand_conv.bn.weight", "backbone.blocks.3.expand_conv.bn.bias", "bac kbone.blocks.3.expand_conv.bn.running_mean", "backbone.blocks.3.expand_conv.bn.running_var", "backbone.blocks.3.bottleneck_conv.conv.weight", "backbone.blocks.3.bottleneck_conv.bn.weig ht", "backbone.blocks.3.bottleneck_conv.bn.bias", "backbone.blocks.3.bottleneck_conv.bn.running_mean", "backbone.blocks.3.bottleneck_conv.bn.running_var", "backbone.blocks.3.mid_se.con v1.weight", "backbone.blocks.3.mid_se.conv1.bias", "backbone.blocks.3.mid_se.conv2.weight", "backbone.blocks.3.mid_se.conv2.bias", "backbone.blocks.3.linear_conv.conv.weight", "backbon e.blocks.3.linear_conv.bn.weight", "backbone.blocks.3.linear_conv.bn.bias", "backbone.blocks.3.linear_conv.bn.running_mean", "backbone.blocks.3.linear_conv.bn.running_var", "backbone.b locks.4.expand_conv.conv.weight", "backbone.blocks.4.expand_conv.bn.weight", "backbone.blocks.4.expand_conv.bn.bias", "backbone.blocks.4.expand_conv.bn.running_mean", "backbone.blocks. 4.expand_conv.bn.running_var", "backbone.blocks.4.bottleneck_conv.conv.weight", "backbone.blocks.4.bottleneck_conv.bn.weight", "backbone.blocks.4.bottleneck_conv.bn.bias", "backbone.bl ocks.4.bottleneck_conv.bn.running_mean", "backbone.blocks.4.bottleneck_conv.bn.running_var", "backbone.blocks.4.mid_se.conv1.weight", "backbone.blocks.4.mid_se.conv1.bias", "backbone.b locks.4.mid_se.conv2.weight", "backbone.blocks.4.mid_se.conv2.bias", "backbone.blocks.4.linear_conv.conv.weight", "backbone.blocks.4.linear_conv.bn.weight", "backbone.blocks.4.linear_c onv.bn.bias", "backbone.blocks.4.linear_conv.bn.running_mean", "backbone.blocks.4.linear_conv.bn.running_var", "backbone.blocks.5.expand_conv.conv.weight", "backbone.blocks.5.expand_co nv.bn.weight", "backbone.blocks.5.expand_conv.bn.bias", "backbone.blocks.5.expand_conv.bn.running_mean", "backbone.blocks.5.expand_conv.bn.running_var", "backbone.blocks.5.bottleneck_c onv.conv.weight", "backbone.blocks.5.bottleneck_conv.bn.weight", "backbone.blocks.5.bottleneck_conv.bn.bias", "backbone.blocks.5.bottleneck_conv.bn.running_mean", "backbone.blocks.5.bo ttleneck_conv.bn.running_var", "backbone.blocks.5.mid_se.conv1.weight", "backbone.blocks.5.mid_se.conv1.bias", "backbone.blocks.5.mid_se.conv2.weight", "backbone.blocks.5.mid_se.conv2. bias", "backbone.blocks.5.linear_conv.conv.weight", "backbone.blocks.5.linear_conv.bn.weight", "backbone.blocks.5.linear_conv.bn.bias", "backbone.blocks.5.linear_conv.bn.running_mean", "backbone.blocks.5.linear_conv.bn.running_var", "backbone.blocks.6.expand_conv.conv.weight", "backbone.blocks.6.expand_conv.bn.weight", "backbone.blocks.6.expand_conv.bn.bias", "backb one.blocks.6.expand_conv.bn.running_mean", "backbone.blocks.6.expand_conv.bn.running_var", "backbone.blocks.6.bottleneck_conv.conv.weight", "backbone.blocks.6.bottleneck_conv.bn.weight ", "backbone.blocks.6.bottleneck_conv.bn.bias", "backbone.blocks.6.bottleneck_conv.bn.running_mean", "backbone.blocks.6.bottleneck_conv.bn.running_var", "backbone.blocks.6.mid_se.conv1 .weight", "backbone.blocks.6.mid_se.conv1.bias", "backbone.blocks.6.mid_se.conv2.weight", "backbone.blocks.6.mid_se.conv2.bias", "backbone.blocks.6.linear_conv.conv.weight", "backbone. blocks.6.linear_conv.bn.weight", "backbone.blocks.6.linear_conv.bn.bias", "backbone.blocks.6.linear_conv.bn.running_mean", "backbone.blocks.6.linear_conv.bn.running_var", "backbone.blo cks.7.expand_conv.conv.weight", "backbone.blocks.7.expand_conv.bn.weight", "backbone.blocks.7.expand_conv.bn.bias", "backbone.blocks.7.expand_conv.bn.running_mean", "backbone.blocks.7. expand_conv.bn.running_var", "backbone.blocks.7.bottleneck_conv.conv.weight", "backbone.blocks.7.bottleneck_conv.bn.weight", "backbone.blocks.7.bottleneck_conv.bn.bias", "backbone.bloc ks.7.bottleneck_conv.bn.running_mean", "backbone.blocks.7.bottleneck_conv.bn.running_var", "backbone.blocks.7.mid_se.conv1.weight", "backbone.blocks.7.mid_se.conv1.bias", "backbone.blo cks.7.mid_se.conv2.weight", "backbone.blocks.7.mid_se.conv2.bias", "backbone.blocks.7.linear_conv.conv.weight", "backbone.blocks.7.linear_conv.bn.weight", "backbone.blocks.7.linear_con v.bn.bias", "backbone.blocks.7.linear_conv.bn.running_mean", "backbone.blocks.7.linear_conv.bn.running_var", "backbone.blocks.8.expand_conv.conv.weight", "backbone.blocks.8.expand_conv .bn.weight", "backbone.blocks.8.expand_conv.bn.bias", "backbone.blocks.8.expand_conv.bn.running_mean", "backbone.blocks.8.expand_conv.bn.running_var", "backbone.blocks.8.bottleneck_con v.conv.weight", "backbone.blocks.8.bottleneck_conv.bn.weight", "backbone.blocks.8.bottleneck_conv.bn.bias", "backbone.blocks.8.bottleneck_conv.bn.running_mean", "backbone.blocks.8.bott leneck_conv.bn.running_var", "backbone.blocks.8.mid_se.conv1.weight", "backbone.blocks.8.mid_se.conv1.bias", "backbone.blocks.8.mid_se.conv2.weight", "backbone.blocks.8.mid_se.conv2.bi as", "backbone.blocks.8.linear_conv.conv.weight", "backbone.blocks.8.linear_conv.bn.weight", "backbone.blocks.8.linear_conv.bn.bias", "backbone.blocks.8.linear_conv.bn.running_mean", " backbone.blocks.8.linear_conv.bn.running_var", "backbone.blocks.9.expand_conv.conv.weight", "backbone.blocks.9.expand_conv.bn.weight", "backbone.blocks.9.expand_conv.bn.bias", "backbon e.blocks.9.expand_conv.bn.running_mean", "backbone.blocks.9.expand_conv.bn.running_var", "backbone.blocks.9.bottleneck_conv.conv.weight", "backbone.blocks.9.bottleneck_conv.bn.weight", "backbone.blocks.9.bottleneck_conv.bn.bias", "backbone.blocks.9.bottleneck_conv.bn.running_mean", "backbone.blocks.9.bottleneck_conv.bn.running_var", "backbone.blocks.9.mid_se.conv1.w eight", "backbone.blocks.9.mid_se.conv1.bias", "backbone.blocks.9.mid_se.conv2.weight", "backbone.blocks.9.mid_se.conv2.bias", "backbone.blocks.9.linear_conv.conv.weight", "backbone.bl ocks.9.linear_conv.bn.weight", "backbone.blocks.9.linear_conv.bn.bias", "backbone.blocks.9.linear_conv.bn.running_mean", "backbone.blocks.9.linear_conv.bn.running_var", "backbone.block s.10.expand_conv.conv.weight", "backbone.blocks.10.expand_conv.bn.weight", "backbone.blocks.10.expand_conv.bn.bias", "backbone.blocks.10.expand_conv.bn.running_mean", "backbone.blocks. 10.expand_conv.bn.running_var", "backbone.blocks.10.bottleneck_conv.conv.weight", "backbone.blocks.10.bottleneck_conv.bn.weight", "backbone.blocks.10.bottleneck_conv.bn.bias", "backbon e.blocks.10.bottleneck_conv.bn.running_mean", "backbone.blocks.10.bottleneck_conv.bn.running_var", "backbone.blocks.10.mid_se.conv1.weight", "backbone.blocks.10.mid_se.conv1.bias", "ba ckbone.blocks.10.mid_se.conv2.weight", "backbone.blocks.10.mid_se.conv2.bias", "backbone.blocks.10.linear_conv.conv.weight", "backbone.blocks.10.linear_conv.bn.weight", "backbone.block s.10.linear_conv.bn.bias", "backbone.blocks.10.linear_conv.bn.running_mean", "backbone.blocks.10.linear_conv.bn.running_var", "backbone.conv2.conv.weight", "backbone.conv2.bn.weight", "backbone.conv2.bn.bias", "backbone.conv2.bn.running_mean", "backbone.conv2.bn.running_var", "neck.encoder.lstm.weight_ih_l0", "neck.encoder.lstm.weight_hh_l0", "neck.encoder.lstm.bias _ih_l0", "neck.encoder.lstm.bias_hh_l0", "neck.encoder.lstm.weight_ih_l0_reverse", "neck.encoder.lstm.weight_hh_l0_reverse", "neck.encoder.lstm.bias_ih_l0_reverse", "neck.encoder.lstm. bias_hh_l0_reverse", "neck.encoder.lstm.weight_ih_l1", "neck.encoder.lstm.weight_hh_l1", "neck.encoder.lstm.bias_ih_l1", "neck.encoder.lstm.bias_hh_l1", "neck.encoder.lstm.weight_ih_l1 _reverse", "neck.encoder.lstm.weight_hh_l1_reverse", "neck.encoder.lstm.bias_ih_l1_reverse", "neck.encoder.lstm.bias_hh_l1_reverse", "head.fc.weight", "head.fc.bias". Unexpected key(s) in state_dict: "backbone.conv.conv.weight", "backbone.conv.bn.weight", "backbone.conv.bn.bias", "backbone.conv.bn.running_mean", "backbone.conv.bn.running_var ", "backbone.conv.bn.num_batches_tracked", "backbone.stages.0.0.expand_conv.conv.weight", "backbone.stages.0.0.expand_conv.bn.weight", "backbone.stages.0.0.expand_conv.bn.bias", "backb one.stages.0.0.expand_conv.bn.running_mean", "backbone.stages.0.0.expand_conv.bn.running_var", "backbone.stages.0.0.expand_conv.bn.num_batches_tracked", "backbone.stages.0.0.bottleneck _conv.conv.weight", "backbone.stages.0.0.bottleneck_conv.bn.weight", "backbone.stages.0.0.bottleneck_conv.bn.bias", "backbone.stages.0.0.bottleneck_conv.bn.running_mean", "backbone.sta ges.0.0.bottleneck_conv.bn.running_var", "backbone.stages.0.0.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.0.0.linear_conv.conv.weight", "backbone.stages.0.0.linear_conv.b n.weight", "backbone.stages.0.0.linear_conv.bn.bias", "backbone.stages.0.0.linear_conv.bn.running_mean", "backbone.stages.0.0.linear_conv.bn.running_var", "backbone.stages.0.0.linear_c onv.bn.num_batches_tracked", "backbone.stages.0.1.expand_conv.conv.weight", "backbone.stages.0.1.expand_conv.bn.weight", "backbone.stages.0.1.expand_conv.bn.bias", "backbone.stages.0.1 .expand_conv.bn.running_mean", "backbone.stages.0.1.expand_conv.bn.running_var", "backbone.stages.0.1.expand_conv.bn.num_batches_tracked", "backbone.stages.0.1.bottleneck_conv.conv.wei ght", "backbone.stages.0.1.bottleneck_conv.bn.weight", "backbone.stages.0.1.bottleneck_conv.bn.bias", "backbone.stages.0.1.bottleneck_conv.bn.running_mean", "backbone.stages.0.1.bottle neck_conv.bn.running_var", "backbone.stages.0.1.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.0.1.linear_conv.conv.weight", "backbone.stages.0.1.linear_conv.bn.weight", "ba ckbone.stages.0.1.linear_conv.bn.bias", "backbone.stages.0.1.linear_conv.bn.running_mean", "backbone.stages.0.1.linear_conv.bn.running_var", "backbone.stages.0.1.linear_conv.bn.num_bat ches_tracked", "backbone.stages.0.2.expand_conv.conv.weight", "backbone.stages.0.2.expand_conv.bn.weight", "backbone.stages.0.2.expand_conv.bn.bias", "backbone.stages.0.2.expand_conv.b n.running_mean", "backbone.stages.0.2.expand_conv.bn.running_var", "backbone.stages.0.2.expand_conv.bn.num_batches_tracked", "backbone.stages.0.2.bottleneck_conv.conv.weight", "backbon e.stages.0.2.bottleneck_conv.bn.weight", "backbone.stages.0.2.bottleneck_conv.bn.bias", "backbone.stages.0.2.bottleneck_conv.bn.running_mean", "backbone.stages.0.2.bottleneck_conv.bn.r unning_var", "backbone.stages.0.2.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.0.2.linear_conv.conv.weight", "backbone.stages.0.2.linear_conv.bn.weight", "backbone.stages. 0.2.linear_conv.bn.bias", "backbone.stages.0.2.linear_conv.bn.running_mean", "backbone.stages.0.2.linear_conv.bn.running_var", "backbone.stages.0.2.linear_conv.bn.num_batches_tracked", "backbone.stages.1.0.expand_conv.conv.weight", "backbone.stages.1.0.expand_conv.bn.weight", "backbone.stages.1.0.expand_conv.bn.bias", "backbone.stages.1.0.expand_conv.bn.running_mean ", "backbone.stages.1.0.expand_conv.bn.running_var", "backbone.stages.1.0.expand_conv.bn.num_batches_tracked", "backbone.stages.1.0.bottleneck_conv.conv.weight", "backbone.stages.1.0.b ottleneck_conv.bn.weight", "backbone.stages.1.0.bottleneck_conv.bn.bias", "backbone.stages.1.0.bottleneck_conv.bn.running_mean", "backbone.stages.1.0.bottleneck_conv.bn.running_var", " backbone.stages.1.0.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.1.0.linear_conv.conv.weight", "backbone.stages.1.0.linear_conv.bn.weight", "backbone.stages.1.0.linear_con v.bn.bias", "backbone.stages.1.0.linear_conv.bn.running_mean", "backbone.stages.1.0.linear_conv.bn.running_var", "backbone.stages.1.0.linear_conv.bn.num_batches_tracked", "backbone.sta ges.1.1.expand_conv.conv.weight", "backbone.stages.1.1.expand_conv.bn.weight", "backbone.stages.1.1.expand_conv.bn.bias", "backbone.stages.1.1.expand_conv.bn.running_mean", "backbone.s tages.1.1.expand_conv.bn.running_var", "backbone.stages.1.1.expand_conv.bn.num_batches_tracked", "backbone.stages.1.1.bottleneck_conv.conv.weight", "backbone.stages.1.1.bottleneck_conv .bn.weight", "backbone.stages.1.1.bottleneck_conv.bn.bias", "backbone.stages.1.1.bottleneck_conv.bn.running_mean", "backbone.stages.1.1.bottleneck_conv.bn.running_var", "backbone.stage s.1.1.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.1.1.linear_conv.conv.weight", "backbone.stages.1.1.linear_conv.bn.weight", "backbone.stages.1.1.linear_conv.bn.bias", "b ackbone.stages.1.1.linear_conv.bn.running_mean", "backbone.stages.1.1.linear_conv.bn.running_var", "backbone.stages.1.1.linear_conv.bn.num_batches_tracked", "backbone.stages.1.2.expand _conv.conv.weight", "backbone.stages.1.2.expand_conv.bn.weight", "backbone.stages.1.2.expand_conv.bn.bias", "backbone.stages.1.2.expand_conv.bn.running_mean", "backbone.stages.1.2.expa nd_conv.bn.running_var", "backbone.stages.1.2.expand_conv.bn.num_batches_tracked", "backbone.stages.1.2.bottleneck_conv.conv.weight", "backbone.stages.1.2.bottleneck_conv.bn.weight", " backbone.stages.1.2.bottleneck_conv.bn.bias", "backbone.stages.1.2.bottleneck_conv.bn.running_mean", "backbone.stages.1.2.bottleneck_conv.bn.running_var", "backbone.stages.1.2.bottlene ck_conv.bn.num_batches_tracked", "backbone.stages.1.2.linear_conv.conv.weight", "backbone.stages.1.2.linear_conv.bn.weight", "backbone.stages.1.2.linear_conv.bn.bias", "backbone.stages .1.2.linear_conv.bn.running_mean", "backbone.stages.1.2.linear_conv.bn.running_var", "backbone.stages.1.2.linear_conv.bn.num_batches_tracked", "backbone.stages.2.0.expand_conv.conv.wei ght", "backbone.stages.2.0.expand_conv.bn.weight", "backbone.stages.2.0.expand_conv.bn.bias", "backbone.stages.2.0.expand_conv.bn.running_mean", "backbone.stages.2.0.expand_conv.bn.run ning_var", "backbone.stages.2.0.expand_conv.bn.num_batches_tracked", "backbone.stages.2.0.bottleneck_conv.conv.weight", "backbone.stages.2.0.bottleneck_conv.bn.weight", "backbone.stage s.2.0.bottleneck_conv.bn.bias", "backbone.stages.2.0.bottleneck_conv.bn.running_mean", "backbone.stages.2.0.bottleneck_conv.bn.running_var", "backbone.stages.2.0.bottleneck_conv.bn.num batches_tracked", "backbone.stages.2.0.linear_conv.conv.weight", "backbone.stages.2.0.linear_conv.bn.weight", "backbone.stages.2.0.linear_conv.bn.bias", "backbone.stages.2.0.linear_co nv.bn.running_mean", "backbone.stages.2.0.linear_conv.bn.running_var", "backbone.stages.2.0.linear_conv.bn.num_batches_tracked", "backbone.stages.2.1.expand_conv.conv.weight", "backbon e.stages.2.1.expand_conv.bn.weight", "backbone.stages.2.1.expand_conv.bn.bias", "backbone.stages.2.1.expand_conv.bn.running_mean", "backbone.stages.2.1.expand_conv.bn.running_var", "ba ckbone.stages.2.1.expand_conv.bn.num_batches_tracked", "backbone.stages.2.1.bottleneck_conv.conv.weight", "backbone.stages.2.1.bottleneck_conv.bn.weight", "backbone.stages.2.1.bottlene ck_conv.bn.bias", "backbone.stages.2.1.bottleneck_conv.bn.running_mean", "backbone.stages.2.1.bottleneck_conv.bn.running_var", "backbone.stages.2.1.bottleneck_conv.bn.num_batches_track ed", "backbone.stages.2.1.linear_conv.conv.weight", "backbone.stages.2.1.linear_conv.bn.weight", "backbone.stages.2.1.linear_conv.bn.bias", "backbone.stages.2.1.linear_conv.bn.running mean", "backbone.stages.2.1.linear_conv.bn.running_var", "backbone.stages.2.1.linear_conv.bn.num_batches_tracked", "backbone.stages.2.2.expand_conv.conv.weight", "backbone.stages.2.2.e xpand_conv.bn.weight", "backbone.stages.2.2.expand_conv.bn.bias", "backbone.stages.2.2.expand_conv.bn.running_mean", "backbone.stages.2.2.expand_conv.bn.running_var", "backbone.stages. 2.2.expand_conv.bn.num_batches_tracked", "backbone.stages.2.2.bottleneck_conv.conv.weight", "backbone.stages.2.2.bottleneck_conv.bn.weight", "backbone.stages.2.2.bottleneck_conv.bn.bia s", "backbone.stages.2.2.bottleneck_conv.bn.running_mean", "backbone.stages.2.2.bottleneck_conv.bn.running_var", "backbone.stages.2.2.bottleneck_conv.bn.num_batches_tracked", "backbone .stages.2.2.linear_conv.conv.weight", "backbone.stages.2.2.linear_conv.bn.weight", "backbone.stages.2.2.linear_conv.bn.bias", "backbone.stages.2.2.linear_conv.bn.running_mean", "backbo ne.stages.2.2.linear_conv.bn.running_var", "backbone.stages.2.2.linear_conv.bn.num_batches_tracked", "backbone.stages.2.3.expand_conv.conv.weight", "backbone.stages.2.3.expand_conv.bn. weight", "backbone.stages.2.3.expand_conv.bn.bias", "backbone.stages.2.3.expand_conv.bn.running_mean", "backbone.stages.2.3.expand_conv.bn.running_var", "backbone.stages.2.3.expand_con v.bn.num_batches_tracked", "backbone.stages.2.3.bottleneck_conv.conv.weight", "backbone.stages.2.3.bottleneck_conv.bn.weight", "backbone.stages.2.3.bottleneck_conv.bn.bias", "backbone. stages.2.3.bottleneck_conv.bn.running_mean", "backbone.stages.2.3.bottleneck_conv.bn.running_var", "backbone.stages.2.3.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.2.3.li near_conv.conv.weight", "backbone.stages.2.3.linear_conv.bn.weight", "backbone.stages.2.3.linear_conv.bn.bias", "backbone.stages.2.3.linear_conv.bn.running_mean", "backbone.stages.2.3. linear_conv.bn.running_var", "backbone.stages.2.3.linear_conv.bn.num_batches_tracked", "backbone.stages.2.4.expand_conv.conv.weight", "backbone.stages.2.4.expand_conv.bn.weight", "back bone.stages.2.4.expand_conv.bn.bias", "backbone.stages.2.4.expand_conv.bn.running_mean", "backbone.stages.2.4.expand_conv.bn.running_var", "backbone.stages.2.4.expand_conv.bn.num_batch es_tracked", "backbone.stages.2.4.bottleneck_conv.conv.weight", "backbone.stages.2.4.bottleneck_conv.bn.weight", "backbone.stages.2.4.bottleneck_conv.bn.bias", "backbone.stages.2.4.bot tleneck_conv.bn.running_mean", "backbone.stages.2.4.bottleneck_conv.bn.running_var", "backbone.stages.2.4.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.2.4.linear_conv.conv .weight", "backbone.stages.2.4.linear_conv.bn.weight", "backbone.stages.2.4.linear_conv.bn.bias", "backbone.stages.2.4.linear_conv.bn.running_mean", "backbone.stages.2.4.linear_conv.bn .running_var", "backbone.stages.2.4.linear_conv.bn.num_batches_tracked", "backbone.stages.2.5.expand_conv.conv.weight", "backbone.stages.2.5.expand_conv.bn.weight", "backbone.stages.2. 5.expand_conv.bn.bias", "backbone.stages.2.5.expand_conv.bn.running_mean", "backbone.stages.2.5.expand_conv.bn.running_var", "backbone.stages.2.5.expand_conv.bn.num_batches_tracked", " backbone.stages.2.5.bottleneck_conv.conv.weight", "backbone.stages.2.5.bottleneck_conv.bn.weight", "backbone.stages.2.5.bottleneck_conv.bn.bias", "backbone.stages.2.5.bottleneck_conv.b n.running_mean", "backbone.stages.2.5.bottleneck_conv.bn.running_var", "backbone.stages.2.5.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.2.5.linear_conv.conv.weight", "bac kbone.stages.2.5.linear_conv.bn.weight", "backbone.stages.2.5.linear_conv.bn.bias", "backbone.stages.2.5.linear_conv.bn.running_mean", "backbone.stages.2.5.linear_conv.bn.running_var", "backbone.stages.2.5.linear_conv.bn.num_batches_tracked", "backbone.stages.3.0.expand_conv.conv.weight", "backbone.stages.3.0.expand_conv.bn.weight", "backbone.stages.3.0.expand_conv. bn.bias", "backbone.stages.3.0.expand_conv.bn.running_mean", "backbone.stages.3.0.expand_conv.bn.running_var", "backbone.stages.3.0.expand_conv.bn.num_batches_tracked", "backbone.stage s.3.0.bottleneck_conv.conv.weight", "backbone.stages.3.0.bottleneck_conv.bn.weight", "backbone.stages.3.0.bottleneck_conv.bn.bias", "backbone.stages.3.0.bottleneck_conv.bn.running_mean ", "backbone.stages.3.0.bottleneck_conv.bn.running_var", "backbone.stages.3.0.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.3.0.linear_conv.conv.weight", "backbone.stages.3 .0.linear_conv.bn.weight", "backbone.stages.3.0.linear_conv.bn.bias", "backbone.stages.3.0.linear_conv.bn.running_mean", "backbone.stages.3.0.linear_conv.bn.running_var", "backbone.sta ges.3.0.linear_conv.bn.num_batches_tracked", "backbone.stages.3.1.expand_conv.conv.weight", "backbone.stages.3.1.expand_conv.bn.weight", "backbone.stages.3.1.expand_conv.bn.bias", "bac kbone.stages.3.1.expand_conv.bn.running_mean", "backbone.stages.3.1.expand_conv.bn.running_var", "backbone.stages.3.1.expand_conv.bn.num_batches_tracked", "backbone.stages.3.1.bottlene ck_conv.conv.weight", "backbone.stages.3.1.bottleneck_conv.bn.weight", "backbone.stages.3.1.bottleneck_conv.bn.bias", "backbone.stages.3.1.bottleneck_conv.bn.running_mean", "backbone.s tages.3.1.bottleneck_conv.bn.running_var", "backbone.stages.3.1.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.3.1.linear_conv.conv.weight", "backbone.stages.3.1.linear_conv .bn.weight", "backbone.stages.3.1.linear_conv.bn.bias", "backbone.stages.3.1.linear_conv.bn.running_mean", "backbone.stages.3.1.linear_conv.bn.running_var", "backbone.stages.3.1.linear _conv.bn.num_batches_tracked", "backbone.stages.3.2.expand_conv.conv.weight", "backbone.stages.3.2.expand_conv.bn.weight", "backbone.stages.3.2.expand_conv.bn.bias", "backbone.stages.3 .2.expand_conv.bn.running_mean", "backbone.stages.3.2.expand_conv.bn.running_var", "backbone.stages.3.2.expand_conv.bn.num_batches_tracked", "backbone.stages.3.2.bottleneck_conv.conv.w eight", "backbone.stages.3.2.bottleneck_conv.bn.weight", "backbone.stages.3.2.bottleneck_conv.bn.bias", "backbone.stages.3.2.bottleneck_conv.bn.running_mean", "backbone.stages.3.2.bott leneck_conv.bn.running_var", "backbone.stages.3.2.bottleneck_conv.bn.num_batches_tracked", "backbone.stages.3.2.linear_conv.conv.weight", "backbone.stages.3.2.linear_conv.bn.weight", " backbone.stages.3.2.linear_conv.bn.bias", "backbone.stages.3.2.linear_conv.bn.running_mean", "backbone.stages.3.2.linear_conv.bn.running_var", "backbone.stages.3.2.linear_conv.bn.num_b atches_tracked", "backbone.stages.3.3.conv.weight", "backbone.stages.3.3.bn.weight", "backbone.stages.3.3.bn.bias", "backbone.stages.3.3.bn.running_mean", "backbone.stages.3.3.bn.runni ng_var", "backbone.stages.3.3.bn.num_batches_tracked", "neck.ins_conv.0.in_conv.weight", "neck.ins_conv.0.se_block.conv1.weight", "neck.ins_conv.0.se_block.conv1.bias", "neck.ins_conv. 0.se_block.conv2.weight", "neck.ins_conv.0.se_block.conv2.bias", "neck.ins_conv.1.in_conv.weight", "neck.ins_conv.1.se_block.conv1.weight", "neck.ins_conv.1.se_block.conv1.bias", "neck .ins_conv.1.se_block.conv2.weight", "neck.ins_conv.1.se_block.conv2.bias", "neck.ins_conv.2.in_conv.weight", "neck.ins_conv.2.se_block.conv1.weight", "neck.ins_conv.2.se_block.conv1.bi as", "neck.ins_conv.2.se_block.conv2.weight", "neck.ins_conv.2.se_block.conv2.bias", "neck.ins_conv.3.in_conv.weight", "neck.ins_conv.3.se_block.conv1.weight", "neck.ins_conv.3.se_bloc k.conv1.bias", "neck.ins_conv.3.se_block.conv2.weight", "neck.ins_conv.3.se_block.conv2.bias", "neck.inp_conv.0.in_conv.weight", "neck.inp_conv.0.se_block.conv1.weight", "neck.inp_conv .0.se_block.conv1.bias", "neck.inp_conv.0.se_block.conv2.weight", "neck.inp_conv.0.se_block.conv2.bias", "neck.inp_conv.1.in_conv.weight", "neck.inp_conv.1.se_block.conv1.weight", "nec k.inp_conv.1.se_block.conv1.bias", "neck.inp_conv.1.se_block.conv2.weight", "neck.inp_conv.1.se_block.conv2.bias", "neck.inp_conv.2.in_conv.weight", "neck.inp_conv.2.se_block.conv1.wei ght", "neck.inp_conv.2.se_block.conv1.bias", "neck.inp_conv.2.se_block.conv2.weight", "neck.inp_conv.2.se_block.conv2.bias", "neck.inp_conv.3.in_conv.weight", "neck.inp_conv.3.se_block .conv1.weight", "neck.inp_conv.3.se_block.conv1.bias", "neck.inp_conv.3.se_block.conv2.weight", "neck.inp_conv.3.se_block.conv2.bias", "head.binarize.conv1.weight", "head.binarize.conv _bn1.weight", "head.binarize.conv_bn1.bias", "head.binarize.conv_bn1.running_mean", "head.binarize.conv_bn1.running_var", "head.binarize.conv_bn1.num_batches_tracked", "head.binarize.c onv2.weight", "head.binarize.conv2.bias", "head.binarize.conv_bn2.weight", "head.binarize.conv_bn2.bias", "head.binarize.conv_bn2.running_mean", "head.binarize.conv_bn2.running_var", " head.binarize.conv_bn2.num_batches_tracked", "head.binarize.conv3.weight", "head.binarize.conv3.bias", "head.thresh.conv1.weight", "head.thresh.conv_bn1.weight", "head.thresh.conv_bn1. bias", "head.thresh.conv_bn1.running_mean", "head.thresh.conv_bn1.running_var", "head.thresh.conv_bn1.num_batches_tracked", "head.thresh.conv2.weight", "head.thresh.conv2.bias", "head. thresh.conv_bn2.weight", "head.thresh.conv_bn2.bias", "head.thresh.conv_bn2.running_mean", "head.thresh.conv_bn2.running_var", "head.thresh.conv_bn2.num_batches_tracked", "head.thresh. conv3.weight", "head.thresh.conv3.bias".

    opened by aibohang 1
  • Multilingual Detection Model convert Fail

    Multilingual Detection Model convert Fail

    Hi Everyone I got an error when convert the Multilingual Detection Model

    BASE INFO

    model: ml_PP-OCRv3_det config: ch_PP-OCRv3_det_cml.yml

    command

    python3 ./converter/ch_ppocr_v3_det_converter.py --src_model_path ./downloads/Multilingual_PP-OCRv3_det_distill_train
    

    ERROR

    paddle weights loading...
    grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
    paddle: Student2.backbone.conv.conv.weight ---- (8, 3, 3, 3)
    paddle: Student.backbone.conv.conv.weight ---- (8, 3, 3, 3)
    paddle: Student2.backbone.conv.bn.weight ---- (8,)
    paddle: Student.backbone.conv.bn.weight ---- (8,)
    paddle: Student2.backbone.conv.bn.bias ---- (8,)
    paddle: Student.backbone.conv.bn.bias ---- (8,)
    paddle: Student2.backbone.conv.bn._mean ---- (8,)
    ... 
    ...
    ...
    pytorch: head.thresh.conv_bn2.bias ---- torch.Size([24])
    pytorch: head.thresh.conv_bn2.running_mean ---- torch.Size([24])
    pytorch: head.thresh.conv_bn2.running_var ---- torch.Size([24])
    pytorch: head.thresh.conv_bn2.num_batches_tracked ---- torch.Size([])
    pytorch: head.thresh.conv3.weight ---- torch.Size([24, 1, 2, 2])
    pytorch: head.thresh.conv3.bias ---- torch.Size([1])
    pytorch: backbone.stages.1.0.mid_se.conv1.weight, torch.Size([10, 40, 1, 1])
    Traceback (most recent call last):
      File "./converter/ch_ppocr_v3_det_converter.py", line 51, in load_paddle_weights
        self.net.state_dict()[k].copy_(torch.Tensor(para_state_dict[ppname]))
    KeyError: 'Student2.backbone.stage1.0.mid_se.conv1.weight'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "./converter/ch_ppocr_v3_det_converter.py", line 73, in <module>
        converter = PPOCRv3DetConverter(cfg, paddle_pretrained_model_path)
      File "./converter/ch_ppocr_v3_det_converter.py", line 13, in __init__
        self.load_paddle_weights(paddle_pretrained_model_path)
      File "./converter/ch_ppocr_v3_det_converter.py", line 54, in load_paddle_weights
        print('paddle: {}, {}'.format(ppname, para_state_dict[ppname].shape))
    KeyError: 'Student2.backbone.stage1.0.mid_se.conv1.weight'
    

    Thank you guys.

    opened by gamegrd 1
  • Error converting model form paddleOCR

    Error converting model form paddleOCR

    HI, thanks for your work!!

    I have probela, I try to convert this model:

    https://github.com/PaddlePaddle/PaddleOCR/#%EF%B8%8F-pp-ocr-series-model-listupdate-on-september-8th

    Chinese and English ultra-lightweight PP-OCRv3 model(16.2M) and English ultra-lightweight PP-OCRv3 model(13.4M

    Using: python3 converter/ch_ppocr_v3_rec_converter.py --src_model_path models/ch_PP-OCRv3_rec_slim_train

    But I get

    Traceback (most recent call last):
      File "converter/ch_ppocr_v3_rec_converter.py", line 60, in load_paddle_weights
        self.net.state_dict()[k].copy_(torch.Tensor(para_state_dict[ppname]))
    KeyError: 'Student.backbone.conv1._conv.weight'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "converter/ch_ppocr_v3_rec_converter.py", line 93, in <module>
        converter = PPOCRv3RecConverter(cfg, paddle_pretrained_model_path)
      File "converter/ch_ppocr_v3_rec_converter.py", line 20, in __init__
        self.load_paddle_weights([para_state_dict, opti_state_dict])
      File "converter/ch_ppocr_v3_rec_converter.py", line 64, in load_paddle_weights
        print('paddle: {}, {}'.format(ppname, para_state_dict[ppname].shape))
    KeyError: 'Student.backbone.conv1._conv.weight'
    

    How I can fix this?

    Thanks

    opened by xellDart 1
  • half precision returning nan

    half precision returning nan

    I'm trying to run inference on the trained models with half precision. The output for the detection model is returning all nan's. Anyone tried to do this before? image

    image
    opened by ririya 0
Owner
null