train_on_xpu_en.md 2.0 KB
Newer Older
G
gaotingquan 已提交
1 2 3 4 5 6
# Introduction to Image Classification Model Kunlun (Continuously updated)

------

## Contents

G
gaotingquan 已提交
7 8 9 10 11 12
- [1. Foreword](#1)
- [2. Training of Kunlun](#2)
  - [2.1 ResNet50](#2.1)
  - [2.2 MobileNetV3](#2.2)
  - [2.3 HRNet](#2.3)
  - [2.4 VGG16/19](#2.4)
G
gaotingquan 已提交
13

G
gaotingquan 已提交
14
<a name='1'></a>
G
gaotingquan 已提交
15 16 17

## 1. Forword

G
gaotingquan 已提交
18
- This document describes the models currently supported by Kunlun and how to train these models on Kunlun devices. To install PaddlePaddle that supports Kunlun, please refer to [install_kunlun](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/09_hardware_support/xpu_docs/paddle_install_cn.html)
G
gaotingquan 已提交
19

G
gaotingquan 已提交
20
<a name='2'></a>
G
gaotingquan 已提交
21 22 23

## 2. Training of Kunlun

G
gaotingquan 已提交
24
- See [quick_start](../quick_start/quick_start_classification_new_user_en.md)for data sources and pre-trained models. The training effect of Kunlun is aligned with CPU/GPU.
G
gaotingquan 已提交
25

G
gaotingquan 已提交
26
<a name='2.1'></a>
G
gaotingquan 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

### 2.1 ResNet50

- Command:

```
python3.7 ppcls/static/train.py \
    -c ppcls/configs/quick_start/kunlun/ResNet50_vd_finetune_kunlun.yaml \
    -o use_gpu=False \
    -o use_xpu=True \
    -o is_distributed=False
```

The difference with cpu/gpu training lies in the addition of -o use_xpu=True, indicating that the execution is on a Kunlun device.

G
gaotingquan 已提交
42
<a name='2.2'></a>
G
gaotingquan 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55

### 2.2 MobileNetV3

- Command:

```
python3.7 ppcls/static/train.py \
    -c ppcls/configs/quick_start/MobileNetV3_large_x1_0.yaml \
    -o use_gpu=False \
    -o use_xpu=True \
    -o is_distributed=False
```

G
gaotingquan 已提交
56
<a name='2.3'></a>
G
gaotingquan 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69

### 2.3 HRNet

- Command:

```
python3.7 ppcls/static/train.py \
    -c ppcls/configs/quick_start/kunlun/HRNet_W18_C_finetune_kunlun.yaml \
    -o is_distributed=False \
    -o use_xpu=True \
    -o use_gpu=False
```

G
gaotingquan 已提交
70
<a name='2.4'></a>
G
gaotingquan 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

### 2.4 VGG16/19

- Command:

```
python3.7 ppcls/static/train.py \
    -c ppcls/configs/quick_start/VGG16_finetune_kunlun.yaml \
    -o use_gpu=False \
    -o use_xpu=True \
    -o is_distributed=False
python3.7 ppcls/static/train.py \
    -c ppcls/configs/quick_start/VGG19_finetune_kunlun.yaml \
    -o use_gpu=False \
    -o use_xpu=True \
    -o is_distributed=False
```