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
deeplabv3_migraphx
Commits
46e8db0a
Commit
46e8db0a
authored
Aug 21, 2025
by
shangxl
Browse files
删除.gitkeep文件,增加convert文件
parent
22aaadc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
Python/convert.py
Python/convert.py
+22
-0
README.md
README.md
+11
-0
Resource/Models/.gitkeep
Resource/Models/.gitkeep
+0
-0
No files found.
Python/convert.py
0 → 100644
View file @
46e8db0a
import
torch
import
torchvision
from
torchvision
import
models
model
=
models
.
segmentation
.
deeplabv3_resnet101
(
pretrained
=
True
)
model
.
eval
()
# 必须切换到推理模式,关闭 dropout/batchnorm 等训练特有的层
# 2. 定义输入张量(需与模型期望的输入尺寸匹配,DeepLabv3通常为513x513)
input_tensor
=
torch
.
randn
(
1
,
3
,
513
,
513
)
# N=1, C=3, H=513, W=513(NCHW格式)
# 3. 导出ONNX模型
onnx_file
=
"../Resource/Models/deeplabv3_resnet101.onnx"
torch
.
onnx
.
export
(
model
,
# 待导出的模型
input_tensor
,
# 示例输入(用于确定计算图结构)
onnx_file
,
# 输出文件路径
opset_version
=
12
,
# ONNX算子集版本(建议≥11,支持更多算子)
input_names
=
[
"images"
],
# 输入节点名称(需与后续推理时一致)
output_names
=
[
"output"
]
# 输出节点名称
)
\ No newline at end of file
README.md
View file @
46e8db0a
...
@@ -50,6 +50,17 @@ docker run --shm-size 16g --network=host --name=deeplabv3_migraphx --privileged
...
@@ -50,6 +50,17 @@ docker run --shm-size 16g --network=host --name=deeplabv3_migraphx --privileged
source /opt/dtk/env.sh
source /opt/dtk/env.sh
```
```
## 模型文件
```
# 进入deeplabv3 migraphx工程根目录
cd <path_to_deeplabv3_migraphx>
# 进入Python目录
cd Python/
# 运行convert.py 生成模型文件 文件保存在Resource/Models目录下
python convert.py
```
## 数据集
## 数据集
根据提供的样本数据,进行图像分割。
根据提供的样本数据,进行图像分割。
...
...
Resource/Models/.gitkeep
deleted
100644 → 0
View file @
22aaadc3
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