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
43.94k stars 7.8k forks source link

总工程文件代码块缺失? #6539

Closed ZimaBlue307 closed 2 years ago

ZimaBlue307 commented 2 years ago

在下载model zoo当中训练好的模型en_PP-OCRv3_det_slim和en_PP-OCRv3_rec以及二者对应config文件之后,想对自己选取的部分图片进行测试,在执行语句python3 tools/eval.py -c configs/det/ch_PP-OCRv3_det_cml.yml -o Global.infer_img="./train_data/en_hand_writing/1.jpg" Global.pretrained_model="./trained_models/en_PP-OCRv3_det_slim_distill_train/student.pdparams"之后,会显示:

NameError: name 'RSEFPN' is not defined

仔细查看config文件之后,模型的框架如下:

Architecture:
  name: DistillationModel
  algorithm: Distillation
  model_type: det
  Models:
    Student:
      model_type: det
      algorithm: DB
      Transform: null
      Backbone:
        name: MobileNetV3
        scale: 0.5
        model_name: large
        disable_se: true
      Neck:
        name: RSEFPN
        out_channels: 96
        shortcut: true
      Head:
        name: DBHead
        k: 50
    Student2:
      model_type: det
      algorithm: DB
      Transform: null
      Backbone:
        name: MobileNetV3
        scale: 0.5
        model_name: large
        disable_se: true
      Neck:
        name: RSEFPN
        out_channels: 96
        shortcut: true
      Head:
        name: DBHead
        k: 50
    Teacher:
      freeze_params: true
      return_all_feats: false
      model_type: det
      algorithm: DB
      Backbone:
        name: ResNet
        in_channels: 3
        layers: 50
      Neck:
        name: LKPAN
        out_channels: 256
      Head:
        name: DBHead
        kernel_list:
        - 7
        - 2
        - 2
        k: 50

其中的两个neck:RSEFPN与LKPAN在目前paddleocr下的neck里貌似根本没有代码,所以导致evaluation过程的出错。想知道怎么解决。

LDOUBLEV commented 2 years ago

请更新你的代码:https://github.com/PaddlePaddle/PaddleOCR/blob/0ba0772c2f869a4b1329dbbf24b406261e15c9d8/ppocr/modeling/necks/db_fpn.py#L217 或者安装最新的paddleocr包