ppocrv3_rec_qat_dist.yaml 2.3 KB
Newer Older
Z
zhouzj 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Global:
  model_dir: ch_PP-OCRv3_rec_infer
  model_filename: inference.pdmodel
  params_filename: inference.pdiparams
  model_type: rec
  algorithm: SVTR
  character_dict_path: ./ppocr_keys_v1.txt
  max_text_length: &max_text_length 25
  use_space_char: true

Distillation:
  alpha: [1.0, 1.0]
  loss: ['skd', 'l2']
  node:
   - ['linear_43.tmp_1']
   - ['linear_43.tmp_1']

Z
zhouzj 已提交
18
QuantAware:
Z
zhouzj 已提交
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
  use_pact: true
  activation_bits: 8
  is_full_quantize: false
  onnx_format: True
  activation_quantize_type: moving_average_abs_max
  weight_quantize_type: channel_wise_abs_max
  not_quant_pattern:
  - skip_quant
  quantize_op_types:
  - conv2d
  - depthwise_conv2d
  weight_bits: 8

TrainConfig:
  epochs: 10
  eval_iter: 2000
  logging_iter: 100
  learning_rate: 
    type: CosineAnnealingDecay 
    learning_rate: 0.00005
  optimizer_builder:
    optimizer:
      type: Adam
    weight_decay: 5.0e-05

PostProcess:
  name: CTCLabelDecode 

Metric:
  name: RecMetric
  main_indicator: acc
  ignore_space: False 

Train:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/icdar2015/text_localization/
    ext_op_transform_idx: 1
    label_file_list:
    - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
    transforms:
    - DecodeImage:
        img_mode: BGR
        channel_first: false
    - RecConAug:
        prob: 0.5
        ext_data_num: 2
        image_shape: [48, 320, 3]
        max_text_length: *max_text_length
    - RecAug:
    - MultiLabelEncode:
    - RecResizeImg:
        image_shape: [3, 48, 320]
    - KeepKeys:
        keep_keys:
        - image
        - label_ctc
        - label_sar
        - length
        - valid_ratio
  loader:
    shuffle: true
    batch_size_per_card: 64
    drop_last: true
    num_workers: 0

Eval:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/icdar2015/text_localization/
    label_file_list:
    - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
    transforms:
    - DecodeImage:
        img_mode: BGR
        channel_first: false
    - MultiLabelEncode:
    - RecResizeImg:
        image_shape: [3, 48, 320]
    - KeepKeys:
        keep_keys:
        - image
        - label_ctc
        - label_sar
        - length
        - valid_ratio
  loader:
    shuffle: false
    drop_last: false
    batch_size_per_card: 64
    num_workers: 0