From c64d55198849017115f5efb73947e6c7089428ba Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Thu, 29 Jul 2021 19:00:19 +0800 Subject: [PATCH] add doc of train --- doc/doc_ch/detection.md | 11 +++++++++-- doc/doc_en/detection_en.md | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/doc_ch/detection.md b/doc/doc_ch/detection.md index 6fc85992..dead9658 100644 --- a/doc/doc_ch/detection.md +++ b/doc/doc_ch/detection.md @@ -45,8 +45,8 @@ json.dumps编码前的图像标注信息是包含多个字典的list,字典中 ## 快速启动训练 首先下载模型backbone的pretrain model,PaddleOCR的检测模型目前支持两种backbone,分别是MobileNetV3、ResNet_vd系列, -您可以根据需求使用[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop/ppcls/modeling/architectures)中的模型更换backbone, -对应的backbone预训练模型可以从[PaddleClas repo 主页中找到下载链接](https://github.com/PaddlePaddle/PaddleClas#mobile-series)。 +您可以根据需求使用[PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop/ppcls/modeling/architectures) 中的模型更换backbone, +对应的backbone预训练模型可以从[PaddleClas repo 主页](https://github.com/PaddlePaddle/PaddleClas#mobile-series) 中找到下载链接。 ```shell cd PaddleOCR/ # 根据backbone的不同选择下载对应的预训练模型 @@ -81,6 +81,13 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/ python3 tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001 ``` +若训练PSE算法,需先编译后处理 + +```bash +cd ppocr/postprocess/pse_postprocess/pse +python3 setup.py build_ext --inplace +``` + #### 断点训练 如果训练程序中断,如果希望加载训练中断的模型从而恢复训练,可以通过指定Global.checkpoints指定要加载的模型路径: diff --git a/doc/doc_en/detection_en.md b/doc/doc_en/detection_en.md index b736beb5..f9cf3d64 100644 --- a/doc/doc_en/detection_en.md +++ b/doc/doc_en/detection_en.md @@ -67,8 +67,12 @@ python3 tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001 # multi-GPU training # Set the GPU ID used by the '--gpus' parameter. python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001 +``` - +If you train the PSE algorithm, you need to compile the post-processing first. +```bash +cd ppocr/postprocess/pse_postprocess/pse +python3 setup.py build_ext --inplace ``` #### load trained model and continue training -- GitLab