README.md 1.81 KB
Newer Older
lijian6's avatar
lijian6 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# ViT_MIGraphX

## 目录
- [目录结构](#目录结构)
- [项目介绍](#项目介绍)
- [环境配置](#环境配置)
- [编译运行](#编译运行)
- [参考数据](#参考数据)
- [历史版本](#历史版本)

## 目录结构
```
├── Images
├── Makefile
├── Models
│   └── model.onnx
├── Python
├── README.md
└── src
    └── main.cpp
```

## 项目介绍

ViT是将Transformer应用到视觉领域模型框架,本项目是ViT模型在MIGraphX框架上的分类推理示例

## 环境配置

推荐使用docker方式运行,提供[光源](https://www.sourcefind.cn/#/service-list)拉取的docker镜像

```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:decode-ffmpeg-dtk23.04
```

## 编译运行

### 编译
```
git clone https://developer.hpccube.com/codes/modelzoo/vit_migraphx.git
cd vit_migraphx
make
```

### 运行

下载推理数据
```
wget https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz
tar -zxvf flower_photos.tgz
```

```
./ViT_MIGraphX
```
根据提示选择要运行的示例程序,比如执行
```
./ViT_MIGraphX --models=Models/model.onnx --input=flower_photos/daisy/
```
运行ViT模型,对daisy图片进行分类


## 准确率数据

测试数据使用的是[flower_photos](https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz),使用的加速卡是DCU Z100

| Engine | Model Path| Data | Accuracy(%) |
| :------: | :------: | :------: | :------: |
| MIGraphX | models/model.onnx | daisy | 98.4 |
| MIGraphX | models/model.onnx | dandelion | 98.1 |
| MIGraphX | models/model.onnx | roses | 91.3 |
| MIGraphX | models/model.onnx | sunflowers | 97.4 |
| MIGraphX | models/model.onnx | tulips | 94.1 |

## 历史版本

https://developer.hpccube.com/codes/modelzoo/vit_migraphx.git