提交 692420fa 编写于 作者: littletomatodonkey's avatar littletomatodonkey 提交者: Tingquan Gao

fix doc

上级 533aa8a7
......@@ -5,7 +5,7 @@ Based on the flowers102 dataset, it takes only 30 mins to experience PaddleClas,
## Preparation
* enter insatallation dir
* Enter insatallation dir.
```
cd path_to_PaddleClas
......@@ -16,7 +16,7 @@ cd path_to_PaddleClas
```shell
cd dataset/flowers102
# If you want to download from the brower, you can copy the link, visit it
# in the browser, download and then commpress.
# in the browser, download and then decommpress.
wget https://paddle-imagenet-models-name.bj.bcebos.com/data/flowers102.zip
unzip flowers102.zip
```
......@@ -49,13 +49,25 @@ cd ../
## Training
* All experiments are running on the NVIDIA® Tesla® V100 single card.
* First of all, use the following command to set visible device.
If you use mac or linux, you can use the following command:
```shell
export CUDA_VISIBLE_DEVICES=0
```
* If you use windows, you can use the following command.
```shell
set CUDA_VISIBLE_DEVICES=0
```
### Train from scratch
* Train ResNet50_vd
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd.yaml
```
......@@ -66,10 +78,9 @@ The validation `Top1 Acc` curve is shown below.
### Finetune - ResNet50_vd pretrained model (Acc 79.12\%)
* finetune ResNet50_vd_ model pretrained on the 1000-class Imagenet dataset
* Finetune ResNet50_vd model pretrained on the 1000-class Imagenet dataset
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_finetune.yaml
```
......@@ -120,11 +131,10 @@ pretrained_model: "./pretrained/ResNet50_vd_ssld_pretrained"
Tringing script
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_ssld_finetune.yaml
```
Compare with finetune on the 79.12% pretrained model, it improve by 0.9% to 95%.
Compare with finetune on the 79.12% pretrained model, it improve by 0.98\% to 95\%.
### More architecture - MobileNetV3
......@@ -132,7 +142,6 @@ Compare with finetune on the 79.12% pretrained model, it improve by 0.9% to 95%.
Training script
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml
```
......@@ -146,7 +155,6 @@ Data augmentation works when training data is small.
Training script
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml
```
......@@ -180,7 +188,6 @@ TRAIN:
Final training script
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml
```
......
......@@ -47,6 +47,19 @@ cd ../
### 2.2 环境说明
* 下面所有的训练过程均在`单卡V100`机器上运行。
* 首先需要设置可用的显卡设备id
如果使用mac或者linux,可以使用下面的命令进行设置。
```shell
export CUDA_VISIBLE_DEVICES=0
```
* 如果使用windows,可以使用下面的命令进行设置。
```shell
set CUDA_VISIBLE_DEVICES=0
```
## 三、模型训练
......@@ -56,7 +69,6 @@ cd ../
* 基于ResNet50_vd模型,训练脚本如下所示。
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd.yaml
```
......@@ -70,7 +82,6 @@ python3 tools/train.py -c ./configs/quick_start/ResNet50_vd.yaml
* 基于ImageNet1k分类预训练模型进行微调,训练脚本如下所示。
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_finetune.yaml
```
......@@ -80,7 +91,6 @@ python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_finetune.yaml
使用训练完的预训练模型对图片`docs/images/quick_start/flowers102/image_06739.jpg`进行预测,预测命令为
```shell
python3 tools/infer/infer.py \
-i docs/images/quick_start/flowers102/image_06739.jpg \
......@@ -119,11 +129,10 @@ pretrained_model: "./pretrained/ResNet50_vd_ssld_pretrained"
训练脚本如下。
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_ssld_finetune.yaml
```
最终flowers102验证集上精度指标为0.95,相对于79.12\%预训练模型的微调结构,新数据集指标可以再次提升0.9\%
最终flowers102验证集上精度指标为0.95,相对于79.12\%预训练模型的微调结构,新数据集指标可以再次提升0.98\%
### 3.4 尝试更多的模型结构-MobileNetV3
......@@ -131,7 +140,6 @@ python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_ssld_finetune.yam
训练脚本如下所示。
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/MobileNetV3_large_x1_0_finetune.yaml
```
......@@ -144,7 +152,6 @@ python3 tools/train.py -c ./configs/quick_start/MobileNetV3_large_x1_0_finetu
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/ResNet50_vd_ssld_random_erasing_finetune.yaml
```
......@@ -180,7 +187,6 @@ TRAIN:
最终的训练脚本如下所示。
```shell
export CUDA_VISIBLE_DEVICES=0
python3 tools/train.py -c ./configs/quick_start/R50_vd_distill_MV3_large_x1_0.yaml
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册