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
ResNet50-v2_tvm
Commits
6834de08
Commit
6834de08
authored
Jul 09, 2024
by
Rayyyyy
Browse files
Add icon
parent
ec4c0101
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
144 additions
and
57 deletions
+144
-57
.vscode/c_cpp_properties.json
.vscode/c_cpp_properties.json
+18
-0
.vscode/launch.json
.vscode/launch.json
+24
-0
.vscode/settings.json
.vscode/settings.json
+59
-0
README.md
README.md
+43
-57
coco128.zip
coco128.zip
+0
-0
icon.png
icon.png
+0
-0
No files found.
.vscode/c_cpp_properties.json
0 → 100644
View file @
6834de08
{
"configurations"
:
[
{
"name"
:
"windows-gcc-x64"
,
"includePath"
:
[
"${workspaceFolder}/**"
],
"compilerPath"
:
"gcc"
,
"cStandard"
:
"${default}"
,
"cppStandard"
:
"${default}"
,
"intelliSenseMode"
:
"windows-gcc-x64"
,
"compilerArgs"
:
[
""
]
}
],
"version"
:
4
}
\ No newline at end of file
.vscode/launch.json
0 → 100644
View file @
6834de08
{
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"name"
:
"C/C++ Runner: Debug Session"
,
"type"
:
"cppdbg"
,
"request"
:
"launch"
,
"args"
:
[],
"stopAtEntry"
:
false
,
"externalConsole"
:
true
,
"cwd"
:
"d:/jobs_2024/modelzoo-icon/tvm_tune_resnet50-v2"
,
"program"
:
"d:/jobs_2024/modelzoo-icon/tvm_tune_resnet50-v2/build/Debug/outDebug"
,
"MIMode"
:
"gdb"
,
"miDebuggerPath"
:
"gdb"
,
"setupCommands"
:
[
{
"description"
:
"Enable pretty-printing for gdb"
,
"text"
:
"-enable-pretty-printing"
,
"ignoreFailures"
:
true
}
]
}
]
}
\ No newline at end of file
.vscode/settings.json
0 → 100644
View file @
6834de08
{
"C_Cpp_Runner.cCompilerPath"
:
"gcc"
,
"C_Cpp_Runner.cppCompilerPath"
:
"g++"
,
"C_Cpp_Runner.debuggerPath"
:
"gdb"
,
"C_Cpp_Runner.cStandard"
:
""
,
"C_Cpp_Runner.cppStandard"
:
""
,
"C_Cpp_Runner.msvcBatchPath"
:
"C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat"
,
"C_Cpp_Runner.useMsvc"
:
false
,
"C_Cpp_Runner.warnings"
:
[
"-Wall"
,
"-Wextra"
,
"-Wpedantic"
,
"-Wshadow"
,
"-Wformat=2"
,
"-Wcast-align"
,
"-Wconversion"
,
"-Wsign-conversion"
,
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings"
:
[
"/W4"
,
"/permissive-"
,
"/w14242"
,
"/w14287"
,
"/w14296"
,
"/w14311"
,
"/w14826"
,
"/w44062"
,
"/w44242"
,
"/w14905"
,
"/w14906"
,
"/w14263"
,
"/w44265"
,
"/w14928"
],
"C_Cpp_Runner.enableWarnings"
:
true
,
"C_Cpp_Runner.warningsAsError"
:
false
,
"C_Cpp_Runner.compilerArgs"
:
[],
"C_Cpp_Runner.linkerArgs"
:
[],
"C_Cpp_Runner.includePaths"
:
[],
"C_Cpp_Runner.includeSearch"
:
[
"*"
,
"**/*"
],
"C_Cpp_Runner.excludeSearch"
:
[
"**/build"
,
"**/build/**"
,
"**/.*"
,
"**/.*/**"
,
"**/.vscode"
,
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer"
:
false
,
"C_Cpp_Runner.useUndefinedSanitizer"
:
false
,
"C_Cpp_Runner.useLeakSanitizer"
:
false
,
"C_Cpp_Runner.showCompilationTime"
:
false
,
"C_Cpp_Runner.useLinkTimeOptimization"
:
false
,
"C_Cpp_Runner.msvcSecureNoWarnings"
:
false
}
\ No newline at end of file
README.md
View file @
6834de08
...
@@ -2,10 +2,12 @@
...
@@ -2,10 +2,12 @@
## 论文
## 论文
`Deep Residual Learning for Image Recognition`
`Deep Residual Learning for Image Recognition`
-
https://arxiv.org/abs/1512.03385
-
https://arxiv.org/abs/1512.03385
## 模型结构
## 模型结构
ResNet50网络中包含了49个卷积层、1个全连接层等
ResNet50网络中包含了49个卷积层、1个全连接层等


## 算法原理
## 算法原理
ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯度爆炸问题,并使得网络可以向更深层发展。
ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯度爆炸问题,并使得网络可以向更深层发展。
...
@@ -14,87 +16,71 @@ ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯
...
@@ -14,87 +16,71 @@ ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯
## 环境配置
## 环境配置
### Docker(方法一)
### Docker(方法一)
拉取镜像:
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:tvm-0.11_fp32_cpp_dtk22.10_py38_centos-7.6-latest
```
创建并启动容器
```
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:tvm-0.11_fp32_cpp_dtk22.10_py38_centos-7.6-latest
docker run --shm-size 16g --network=host --name=ResNet50_v2 --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -it <Your Image ID> /bin/bash
docker run --shm-size 16g --network=host --name=ResNet50_v2 --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -it <Your Image ID> /bin/bash
# 激活dtk
# 激活dtk
source /opt/dtk/env.sh
source /opt/dtk/env.sh
```
```
## 数据集
## 数据集
python 推理及调优代码使用的图片数据为:
python推理及调优代码使用的图片数据为:
[
kitten
](
./kitten.jpg
)
```
"https://s3.amazonaws.com/model-server/inputs/kitten.jpg"
```
标签数据为:
```
"https://s3.amazonaws.com/onnx-model-zoo/synset.txt"
```
C++部署代码使用数据为:
```
"https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip"
coco128数据集的目录结构如下:
标签数据为:
[
synset.txt
](
./synset.txt
)
├── images
│ ├── train2017
├── labels
│ ├── train2017
├── LICENSE
├── README.txt
C++部署代码使用数据为:
[
coco128
](
./coco128.zip
)
coco128数据集的目录结构如下:
```
```
## 推理
├── images
模型文件下载地址:
│ ├── train2017
```
├── labels
"https://github.com/onnx/models/raw/main/vision/classification/resnet/model/resnet50-v2-7.onnx"
│ ├── train2017
```
├── LICENSE
下载模型文件后执行以下命令进行推理测试及调优测试:
├── README.txt
```
git clone http://developer.hpccube.com/codes/modelzoo/tvm_tune_resnet50-v2.git
cd tvm_tune_resnet50-v2
export HIP_VISIBLE_DEVICES=1 #此处为指定哪张加速卡进行推理的ID号
python tune_resnet50-v2.py #根据实际修改模型路径
```
```
## 推理
下载模型文件
[
resnet50-v2-7.onnx
](
http://113.200.138.88:18080/aimodels/findsource-dependency/tvm_tune_resnet50-v2/-/blob/main/resnet50-v2-7.onnx
)
,执行以下命令进行推理测试及调优测试:
```
bash
git clone http://developer.hpccube.com/codes/modelzoo/tvm_tune_resnet50-v2.git
cd
tvm_tune_resnet50-v2
export
HIP_VISIBLE_DEVICES
=
1
#此处为指定哪张加速卡进行推理的ID号
python tune_resnet50-v2.py
#根据实际修改模型路径
```
### 单卡部署推理测试
### 单卡部署推理测试
下载配置好镜像之后,cd /tvm-0.11-dev0/apps/ 进入该路径下,将代码下载放到该路径下,cd tvm_tune_resnet50-v2/ 进入该路径后,
下载配置好镜像之后,执行以下命令:
执行以下命令:
```
bash
# 进入该路径下
cd
/tvm-0.11-dev0/apps/
# 将代码下载放到该路径下
# 进入
cd
tvm_tune_resnet50-v2/
# 执行
mkdir
-p
lib
export
HIP_VISIBLE_DEVICES
=
1
#此处为指定哪张加速卡进行推理的ID号
python prepare_test_libs.py
#根据实际修改模型路径
sh run_example.sh
```
```
mkdir -p lib
export HIP_VISIBLE_DEVICES=1 #此处为指定哪张加速卡进行推理的ID号
python prepare_test_libs.py #根据实际修改模型路径
sh run_example.sh
```
## result
## result


### 精度
### 精度
```
| max_num | max_iter | max_num_index |
max_num:15.6692
| :------: | :------: | :------: |
max_iter:0x28cda14
| 15.6692 | 0x28cda14 | 345 |
max_num_index:345
```
## 应用场景
## 应用场景
### 算法类别
### 算法类别
图像分类
图像分类
### 热点应用行业
### 热点应用行业
制造,政府,医疗,科研
制造,政府,医疗,科研
## 源码仓库及问题反馈
## 源码仓库及问题反馈
-
https://developer.hpccube.com/codes/modelzoo/tvm_tune_resnet50-v2
https://developer.hpccube.com/codes/modelzoo/tvm_tune_resnet50-v2
### 参考资料
### 参考资料
-
https://tvm.apache.org/docs
https://tvm.apache.org/docs
coco128.zip
0 → 100644
View file @
6834de08
File added
icon.png
0 → 100644
View file @
6834de08
64.6 KB
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