add finetune doc and fix vit typo (#996)

pull/997/head
littletomatodonkey 2021-06-30 19:59:17 +08:00 committed by GitHub
parent 38fa856432
commit b67b1df391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 5 deletions

View File

@ -64,9 +64,7 @@ cd PaddleDetection
pip install -r requirements.txt
```
For more installation tutorials, please refer to [Installation tutorial]()
更多安装教程,请参考: [安装文档](https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/docs/tutorials/INSTALL.md)
For more installation tutorials, please refer to [Installation tutorial](https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/docs/tutorials/INSTALL.md)
### 3.2 Prepare for the dataset
@ -126,6 +124,16 @@ python -m paddle.distributed.launch --gpus 0,1,2,3 tools/train.py -c configs/ppy
--evaleval during training
* (**Recommend**) Model finetune
If you want to finetune the model on your own dataset, you can run the following command to train the model.
```bash
export CUDA_VISIBLE_DEVICES=0
# assign pretrain_weights, load the general mainbody-detection pretrained model
python tools/train.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml -o pretrain_weights=https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/pretrain/ppyolov2_r50vd_dcn_mainbody_v1.0_pretrained.pdparams
```
* Resume training: you can use `-r` to load checkpoints and resume training.
```bash

View File

@ -117,7 +117,18 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3
python -m paddle.distributed.launch --gpus 0,1,2,3 tools/train.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml --eval
```
--eval表示边训练边验证
--eval表示边训练边验证。
* (**推荐**)模型微调
如果希望加载PaddleClas中已经训练好的主体检测模型在自己的数据集上进行模型微调可以使用下面的命令进行训练。
```bash
export CUDA_VISIBLE_DEVICES=0
# 指定pretrain_weights参数加载通用的主体检测预训练模型
python tools/train.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml -o pretrain_weights=https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/pretrain/ppyolov2_r50vd_dcn_mainbody_v1.0_pretrained.pdparams
```
* 模型恢复训练

View File

@ -16,7 +16,7 @@ Global:
# model architecture
Arch:
name: ViT_base_patch16_224
name: ViT_base_patch16_384
class_num: 1000
# loss function config for traing/eval process