Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ViT_migraphx
Commits
da529d77
Commit
da529d77
authored
Jun 07, 2023
by
lijian6
Browse files
modify readme.md and model.properties.
Signed-off-by:
lijian
<
lijian6@sugon.com
>
parent
ea13d43e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
Python/README.md
Python/README.md
+8
-5
README.md
README.md
+1
-1
model.properties
model.properties
+1
-1
No files found.
Python/README.md
View file @
da529d77
...
...
@@ -3,7 +3,7 @@
*
@email: lijian6@sugon.com
*
@Date: 2023-06-06
*
@LastEditTime: 2023-06-06
*
@FilePath:
\l
pr
\
R
EADME.md
*
@FilePath: README.md
-->
# Vision Transformer(ViT)
...
...
@@ -22,20 +22,23 @@ Vision Transformer模型结构如下图所示主要包括三部分,patch embed
## 训练
### 环境配置
在
[
光源
](
https://www.sourcefind.cn/#/service-details
)
可拉取训练以及推理的docker镜像,推荐的镜像如下:
在
[
光源
](
https://www.sourcefind.cn/#/service-details
)
可拉取训练的docker镜像,推荐的镜像如下:
*
训练镜像:docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.10.0-centos7.6-dtk-22.10.1-py37-latest
在
[
光合开发者社区
](
https://cancon.hpccube.com:65024/4/main/
)
可
下载MIGraphX
:
若想使用MIGraphX做推理,可
在
[
光合开发者社区
](
https://cancon.hpccube.com:65024/4/main/
)
中
下载MIGraphX
.
### Fine-tunning
模型的训练程序是train.py,预训练模型为
[
base_patch16_224_in21k
](
https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-vitjx/jx_vit_base_patch16_224_in21k-e5005f0a.pth
)
,需要先下载与训练模型。fine-tuning训练模型使用以下命令:
模型的训练程序是train.py,预训练模型为
[
base_patch16_224_in21k
](
https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-vitjx/jx_vit_base_patch16_224_in21k-e5005f0a.pth
)
,需要先下载预训练模型。fine-tuning训练模型使用以下命令:
python train.py
Fine-tuning时可调整epoch参数来调整模型。
### 预训练模型
在weights文件夹下我们提供了一个预训练模型以及对应的fine-tuning模型和onnx模型。
本项目使用
[
base_patch16_224_in21k
](
https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-vitjx/jx_vit_base_patch16_224_in21k-e5005f0a.pth
)
为预训练模型,需自行下载。下载完预训练模型和数据集,即可开始fine-tun。可用torch进行推理,也可转为onnx模型使用MIGraphX进行推理。
### 推理
推理测试模型用infer_pytroch.py和infer_migraphx.py对训练出的模型进行推理,使用方法如下:
...
...
README.md
View file @
da529d77
...
...
@@ -22,7 +22,7 @@
## 项目介绍
ViT是将Transformer应用到视觉领域模型
框架
,本项目是ViT模型在MIGraphX框架上的分类推理示例
ViT是将Transformer应用到视觉领域
的
模型
结构
,本项目是ViT模型在MIGraphX
推理
框架上的分类推理示例
## 环境配置
...
...
model.properties
View file @
da529d77
...
...
@@ -3,6 +3,6 @@ modelName=Vision_Transformer
# 模型描述
modelDescription
=
ViT是一个基于transformer的视觉图像分类模型
# 应用场景(多个标签以英文逗号分割)
appScenario
=
MIGraphX,Pythorch,图形分类,训练,推理,train,inference
,C++
appScenario
=
训练,推理,train,inference,Pythorch,MIGraphX,图像分类
,C++
# 框架类型(多个标签以英文逗号分割)
frameType
=
MIGraphX,Pythorch
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment