Commit 53c59266 authored by yuguo's avatar yuguo
Browse files

update

parent 5da8f5a7
# Resnet50
## 模型介绍
使用OneFlow进行Resnet50的训练与推理
## 论文
`Deep Residual Learning for Image Recognition`
- [https://arxiv.org/abs/1512.03385](https://arxiv.org/abs/1512.03385)
## 模型结构
Resnet50 网络中包含了 49 个卷积层、1个全连接层等。
## 算法原理
ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯度爆炸问题,并使得网络可以向更深层发展。
## 环境配置
### Docker
```plaintext
docker pull image.sourcefind.cn:5000/dcu/admin/base/oneflow:0.9.1-centos7.6-dtk-22.10.1-py39-latest
# <Your Image ID>用上面拉取docker镜像的ID替换
docker run --shm-size 16g --network=host --name=resnet50_oneflow --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/resnet50_oneflow:/home/resnet50_oneflow -it <Your Image ID> bash
cd /home/resnet50_oneflow
pip install -r requirements.txt
```
## 数据集
我们考虑到imagenet数据集比较庞大,为了用户可以使用OneFlow快速进行Resnet50的训练验证,采用mini-imagenet小数据集。如果需要原始数据需要参考该链接https://github.com/Oneflow-Inc/models/tree/main/Vision/classification/image/resnet50#prepare-ofrecord-for-the-full-imagenet-dataset进行转换为ofrecord
OFRECORD_PATH="./mini-imagenet/ofrecord"
制作完成的TFRrecord数据形式如下:
```plaintext
ofrecord-imagenet
|
train-00000-of-01024
train-00001-of-01024
...
train-01022-of-01024
train-01023-of-01024
validation-00000-of-00128
validation-00001-of-00128
...
validation-00126-of-00128
validation-00127-of-00128
```
## 训练及推理
### 环境配置
提供[光源](https://www.sourcefind.cn/#/service-details)拉取的docker镜像:image.sourcefind.cn:5000/dcu/admin/base/oneflow:0.9.1-centos7.6-dtk-22.10.1-py39-latest
### fp32训练
单机单卡训练命令:
bash examples/train_graph_distributed_fp32.sh
......@@ -30,16 +73,26 @@ Resnet50 网络中包含了 49 个卷积层、1个全连接层等。
执行推理命令:
bash examples/infer_graph.sh
## 训练精度
### 训练精度
测试数据:mini-imagenet,使用的加速卡:4张DCU-Z100-16G。
根据模型情况填写表格:
| 卡数 | batch size | 类型 | Accuracy(%) |
| :------: | :------: | :------: | -------- |
| 1 | 128 | fp32 | 76.5/50 epoch |
| 1 | 128 | fp16 | 76.3/50 epoch |
| 4 | 128 | fp32 | 76.5/50 epoch |
| 4 | 128 | fp16 | 76.3/50 epoch |
| 1 | 128 | fp32 | 76.5/300 epoches |
| 1 | 128 | fp16 | 76.3/300 epoches |
| 4 | 128 | fp32 | 76.5/300 epoches |
| 4 | 128 | fp16 | 76.3/300 epoches |
## 应用场景
### 算法类别
`图像分类`
### 热点应用行业
`制造,政府,医疗,科研`
## 源码仓库及问题反馈
- https://developer.hpccube.com/codes/modelzoo/resnet50_oneflow
......
# 模型唯一标识
modelCode=66
# 模型名称
modelName=Resnet50_OneFlow
# 模型描述
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment