目录
如果你要安装PaddleHub,不要使用python 3.12
设置系统变量:HUB_HOME,修改PaddleHub模型目录
Could not locate zlibwapi.dll问题
如果你要安装PaddleHub,不要使用python 3.12
用到了sentencepiece 0.1.99版本,3.12版本py无法编译成功 可以使用 pip install sentencepiece==0.1.99 测试是否可以安装
设置系统变量:HUB_HOME,修改PaddleHub模型目录
Could not locate zlibwapi.dll问题
缺少zlibwapi.dll,网上都说去nvidia下载,里面内容已经更新了,找不到下载的地方了
模型训练主要参数说明:
epoch_num: 总的训练轮数
print_batch_step: 每隔多少个batch打印一回信息
save_model_dir: 模型保存路径
save_epoch_step: 模型保存时间间隔,以epoch计
eval_batch_step: 在第0个batch后每隔500个batch评估一次
batch_size_per_card: 每个batch运行的图片数,过多会爆显存
pretrained_model: 预训练模型(F:\paddle_train\output\verify\tran\en_PP-OCRv4_rec_train\best_accuracy)
character_dict_path:字典(F:\paddle_train\output\verify\data\new_dict.txt)
加入自动混合精度训练提高训练速度
use_amp: True
scale_loss: 1024.0
use_dynamic_loss_scaling: True
use_gpu: true
Global:
debug: false
use_amp: True
scale_loss: 1024.0
use_dynamic_loss_scaling: True
use_gpu: true
epoch_num: 50
log_smooth_window: 20
print_batch_step: 10
save_model_dir: F:\paddle_train\output\verify\output\rec_verify_v4
save_epoch_step: 3
eval_batch_step:
- 0
- 500
cal_metric_during_train: true
pretrained_model: F:\paddle_train\output\verify\tran\en_PP-OCRv4_rec_train\best_accuracy
checkpoints: null
save_inference_dir: F:\paddle_train\output\verify\output\inference
use_visualdl: false
infer_img: doc\imgs_words\ch\word_1.jpg
character_dict_path: F:\paddle_train\output\verify\data\new_dict.txt
max_text_length: 6
infer_mode: false
use_space_char: false
distributed: true
save_res_path: F:\paddle_train\output\verify\output\rec\predicts_ppocrv3.txt
Optimizer:
name: Adam
beta1: 0.9
beta2: 0.999
lr:
name: Cosine
learning_rate: 0.0005
warmup_epoch: 5
regularizer:
name: L2
factor: 3.0e-05
Architecture:
model_type: rec
algorithm: SVTR_LCNet
Transform: null
Backbone:
name: PPLCNetV3
scale: 0.95
Head:
name: MultiHead
head_list:
- CTCHead:
Neck:
name: svtr
dims: 120
depth: 2
hidden_dims: 120
kernel_size:
- 1
- 3
use_guide: true
Head:
fc_decay: 1.0e-05
- NRTRHead:
nrtr_dim: 384
max_text_length: 6
Loss:
name: MultiLoss
loss_config_list:
- CTCLoss: null
- NRTRLoss: null
PostProcess:
name: CTCLabelDecode
Metric:
name: RecMetric
main_indicator: acc
ignore_space: false
Train:
dataset:
name: MultiScaleDataSet
ds_width: false
data_dir: F:\paddle_train\output\verify\data\verification_code
ext_op_transform_idx: 1
label_file_list:
- F:\paddle_train\output\verify\data\train_list.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: 6
- RecAug: null
- MultiLabelEncode:
gtc_encode: NRTRLabelEncode
- KeepKeys:
keep_keys:
- image
- label_ctc
- label_gtc
- length
- valid_ratio
sampler:
name: MultiScaleSampler
scales:
- - 320
- 32
- - 320
- 48
- - 320
- 64
first_bs: 96
fix_bs: false
divided_factor:
- 8
- 16
is_training: true
loader:
shuffle: true
batch_size_per_card: 65
drop_last: true
num_workers: 4
Eval:
dataset:
name: SimpleDataSet
data_dir: F:\paddle_train\output\verify\data\verification_code
label_file_list:
- F:\paddle_train\output\verify\data\test_list.txt
transforms:
- DecodeImage:
img_mode: BGR
channel_first: false
- MultiLabelEncode:
gtc_encode: NRTRLabelEncode
- RecResizeImg:
image_shape:
- 3
- 48
- 320
- KeepKeys:
keep_keys:
- image
- label_ctc
- label_gtc
- length
- valid_ratio
loader:
shuffle: false
drop_last: false
batch_size_per_card: 32
num_workers: 4
profiler_options: null