epoch: [300/300], iter: 41370, lr: 0.000500, loss: 0.032471, acc: 1.000000, norm_edit_dis: 1.000000, reader_cost: 0.00178 s, batch_cost: 0.09483 s, samples: 320, ips: 337.42971
epoch: [300/300], iter: 41380, lr: 0.000500, loss: 0.032471, acc: 1.000000, norm_edit_dis: 1.000000, reader_cost: 0.00010 s, batch_cost: 0.09192 s, samples: 320, ips: 348.14319
epoch: [300/300], iter: 41390, lr: 0.000500, loss: 0.023093, acc: 1.000000, norm_edit_dis: 1.000000, reader_cost: 0.00010 s, batch_cost: 0.07407 s, samples: 320, ips: 432.01792
save model in ./output/rec/ic15/latest
save model in ./output/rec/ic15/iter_epoch_300
best metric, acc: 0.00732421875, norm_edit_dis: 0.12190923293828548, fps: 833.680501500976, best_epoch: 102
[2021/05/28 14:05:50] root INFO: Architecture :
[2021/05/28 14:05:50] root INFO: Backbone :
[2021/05/28 14:05:50] root INFO: model_name : large
[2021/05/28 14:05:50] root INFO: name : MobileNetV3
[2021/05/28 14:05:50] root INFO: scale : 0.5
[2021/05/28 14:05:50] root INFO: Head :
[2021/05/28 14:05:50] root INFO: fc_decay : 0
[2021/05/28 14:05:50] root INFO: name : CTCHead
[2021/05/28 14:05:50] root INFO: Neck :
[2021/05/28 14:05:50] root INFO: encoder_type : rnn
[2021/05/28 14:05:50] root INFO: hidden_size : 96
[2021/05/28 14:05:50] root INFO: name : SequenceEncoder
[2021/05/28 14:05:50] root INFO: Transform : None
[2021/05/28 14:05:50] root INFO: algorithm : CRNN
[2021/05/28 14:05:50] root INFO: model_type : rec
[2021/05/28 14:05:50] root INFO: Eval :
[2021/05/28 14:05:50] root INFO: dataset :
[2021/05/28 14:05:50] root INFO: data_dir : ./train_data/ic15_data
[2021/05/28 14:05:50] root INFO: label_file_list : ['./train_data/ic15_data/rec_gt_test.txt']
[2021/05/28 14:05:50] root INFO: name : SimpleDataSet
[2021/05/28 14:05:50] root INFO: transforms :
[2021/05/28 14:05:50] root INFO: DecodeImage :
[2021/05/28 14:05:50] root INFO: channel_first : False
[2021/05/28 14:05:50] root INFO: img_mode : BGR
[2021/05/28 14:05:50] root INFO: CTCLabelEncode : None
[2021/05/28 14:05:50] root INFO: RecResizeImg :
[2021/05/28 14:05:50] root INFO: image_shape : [3, 32, 100]
[2021/05/28 14:05:50] root INFO: KeepKeys :
[2021/05/28 14:05:50] root INFO: keep_keys : ['image', 'label', 'length']
[2021/05/28 14:05:50] root INFO: loader :
[2021/05/28 14:05:50] root INFO: batch_size_per_card : 32
[2021/05/28 14:05:50] root INFO: drop_last : False
[2021/05/28 14:05:50] root INFO: num_workers : 4
[2021/05/28 14:05:50] root INFO: shuffle : False
[2021/05/28 14:05:50] root INFO: use_shared_memory : False
[2021/05/28 14:05:50] root INFO: Global :
[2021/05/28 14:05:50] root INFO: cal_metric_during_train : True
[2021/05/28 14:05:50] root INFO: character_dict_path : ppocr/utils/ic15_dict.txt
[2021/05/28 14:05:50] root INFO: character_type : ch
[2021/05/28 14:05:50] root INFO: checkpoints : None
[2021/05/28 14:05:50] root INFO: debug : False
[2021/05/28 14:05:50] root INFO: distributed : False
[2021/05/28 14:05:50] root INFO: epoch_num : 300
[2021/05/28 14:05:50] root INFO: eval_batch_step : [0, 2000]
[2021/05/28 14:05:50] root INFO: infer_img : D:/Download/paddleocr/PaddleOCR-release-2.1/train_data/ic15_data/train/word_71.png
[2021/05/28 14:05:50] root INFO: infer_mode : False
[2021/05/28 14:05:50] root INFO: load_static_weights : False
[2021/05/28 14:05:50] root INFO: log_smooth_window : 20
[2021/05/28 14:05:50] root INFO: max_text_length : 25
[2021/05/28 14:05:50] root INFO: pretrained_model : D:/Download/paddleocr/PaddleOCR-release-2.1/output/rec/ic15/best_accuracy
[2021/05/28 14:05:50] root INFO: print_batch_step : 10
[2021/05/28 14:05:50] root INFO: save_epoch_step : 3
[2021/05/28 14:05:50] root INFO: save_inference_dir : ./output/
[2021/05/28 14:05:50] root INFO: save_model_dir : ./output/ic15_batch64/
[2021/05/28 14:05:50] root INFO: save_res_path : ./output/rec/predicts_ic15.txt
[2021/05/28 14:05:50] root INFO: use_gpu : True
[2021/05/28 14:05:50] root INFO: use_space_char : False
[2021/05/28 14:05:50] root INFO: use_visualdl : True
[2021/05/28 14:05:50] root INFO: Loss :
[2021/05/28 14:05:50] root INFO: name : CTCLoss
[2021/05/28 14:05:50] root INFO: Metric :
[2021/05/28 14:05:50] root INFO: main_indicator : acc
[2021/05/28 14:05:50] root INFO: name : RecMetric
[2021/05/28 14:05:50] root INFO: Optimizer :
[2021/05/28 14:05:50] root INFO: beta1 : 0.9
[2021/05/28 14:05:50] root INFO: beta2 : 0.999
[2021/05/28 14:05:50] root INFO: lr :
[2021/05/28 14:05:50] root INFO: learning_rate : 0.005
[2021/05/28 14:05:50] root INFO: name : Adam
[2021/05/28 14:05:50] root INFO: regularizer :
[2021/05/28 14:05:50] root INFO: factor : 0
[2021/05/28 14:05:50] root INFO: name : L2
[2021/05/28 14:05:50] root INFO: PostProcess :
[2021/05/28 14:05:50] root INFO: name : CTCLabelDecode
[2021/05/28 14:05:50] root INFO: Train :
[2021/05/28 14:05:50] root INFO: dataset :
[2021/05/28 14:05:50] root INFO: data_dir : ./train_data/ic15_data
[2021/05/28 14:05:50] root INFO: label_file_list : ['./train_data/ic15_data/rec_gt_train.txt']
[2021/05/28 14:05:50] root INFO: name : SimpleDataSet
[2021/05/28 14:05:50] root INFO: transforms :
[2021/05/28 14:05:50] root INFO: DecodeImage :
[2021/05/28 14:05:50] root INFO: channel_first : False
[2021/05/28 14:05:50] root INFO: img_mode : BGR
[2021/05/28 14:05:50] root INFO: CTCLabelEncode : None
[2021/05/28 14:05:50] root INFO: RecResizeImg :
[2021/05/28 14:05:50] root INFO: image_shape : [3, 32, 100]
[2021/05/28 14:05:50] root INFO: KeepKeys :
[2021/05/28 14:05:50] root INFO: keep_keys : ['image', 'label', 'length']
[2021/05/28 14:05:50] root INFO: loader :
[2021/05/28 14:05:50] root INFO: batch_size_per_card : 32
[2021/05/28 14:05:50] root INFO: drop_last : True
[2021/05/28 14:05:50] root INFO: num_workers : 8
[2021/05/28 14:05:50] root INFO: shuffle : True
[2021/05/28 14:05:50] root INFO: use_shared_memory : False
[2021/05/28 14:05:50] root INFO: train with paddle 2.1.0 and device CUDAPlace(0)
W0528 14:05:50.568840 15300 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.3, Runtime API Version: 10.1
W0528 14:05:50.584471 15300 device_context.cc:422] device: 0, cuDNN Version: 7.6.
[2021/05/28 14:05:52] root INFO: load pretrained model from ['D:/Download/paddleocr/PaddleOCR-release-2.1/output/rec/ic15/best_accuracy']
[2021/05/28 14:05:52] root INFO: infer_img: D:/Download/paddleocr/PaddleOCR-release-2.1/train_data/ic15_data/train/word_71.png
[2021/05/28 14:05:52] root INFO: result: ('19', 0.92347664)
[2021/05/28 14:05:52] root INFO: success!
Global:
use_gpu: True
epoch_num: 300
log_smooth_window: 20
print_batch_step: 10
save_model_dir: ./output/rec/ic15/
save_epoch_step: 3
# evaluation is run every 2000 iterations
eval_batch_step: [0, 2000]
cal_metric_during_train: True
pretrained_model: ./pretrain_models/best_accuracy
checkpoints:
save_inference_dir: ./output/
use_visualdl: True
infer_img: doc/imgs_words_en/word_10.png
# for data or label process
character_dict_path: ppocr/utils/ic15_dict.txt
character_type: ch
max_text_length: 25
infer_mode: False
use_space_char: False
save_res_path: ./output/rec/predicts_ic15.txt
Optimizer:
name: Adam
beta1: 0.9
beta2: 0.999
lr:
learning_rate: 0.005
regularizer:
name: 'L2'
factor: 0
Architecture:
model_type: rec
algorithm: CRNN
Transform:
Backbone:
name: MobileNetV3
scale: 0.5
model_name: large
Neck:
name: SequenceEncoder
encoder_type: rnn
hidden_size: 96
Head:
name: CTCHead
fc_decay: 0
Loss:
name: CTCLoss
PostProcess:
name: CTCLabelDecode
Metric:
name: RecMetric
main_indicator: acc
Train:
dataset:
name: SimpleDataSet
data_dir: ./train_data/ic15_data
label_file_list: ["./train_data/ic15_data/rec_gt_train.txt"]
transforms:
- DecodeImage: # load image
img_mode: BGR
channel_first: False
- CTCLabelEncode: # Class handling label
- RecResizeImg:
image_shape: [3, 32, 100]
- KeepKeys:
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
loader:
shuffle: True
batch_size_per_card: 32
drop_last: True
num_workers: 8
use_shared_memory: False
Eval:
dataset:
name: SimpleDataSet
data_dir: ./train_data/ic15_data
label_file_list: ["./train_data/ic15_data/rec_gt_test.txt"]
transforms:
- DecodeImage: # load image
img_mode: BGR
channel_first: False
- CTCLabelEncode: # Class handling label
- RecResizeImg:
image_shape: [3, 32, 100]
- KeepKeys:
keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
loader:
shuffle: False
drop_last: False
batch_size_per_card: 32
num_workers: 4
use_shared_memory: False
新手入门的话,强烈建议先试试这个baseline,然后换个数据试一下
https://aistudio.baidu.com/aistudio/projectdetail/1884141,
加一个正则化权重;
将batch_size调大(4的整数倍);
如果使用预训练权重,学习率也要注意,此时学习率不宜过大或者过小,最好先warmup预热一下,找到哪个学习率最合适哪个
刚开始训练eval_batch_step参数不要设置太大,基本上一个batch需要验证一次,这样才能发现问题