Commit 4e398183 authored by “qianyj”'s avatar “qianyj”
Browse files

Add dockerfile and Update README

parent 60b5997d
# 模型名称 # ResNet50
## 模型介绍
使用TensorFlow2进行ResNet50的训练 ## 论文
`Deep Residual Learning for Image Recognition`
- https://arxiv.org/abs/1512.03385
## 模型结构 ## 模型结构
ResNet50网络中包含了49个卷积层、1个全连接层等 ResNet50网络中包含了49个卷积层、1个全连接层等
![img](./doc/ResNet50.png)
## 算法原理
ResNet50使用了多个具有残差连接的残差块来解决梯度消失或梯度爆炸问题,并使得网络可以向更深层发展。
![img](./doc/Residual_Block.png)
## 环境配置
### Docker(方法一)
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/tensorflow:2.7.0-centos7.6-dtk-22.10.1-py38-latest
# <Your Image ID>用上面拉取docker镜像的ID替换
docker run --shm-size 16g --network=host --name=ResNet50-TensorFlow2x --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/ResNet50-TensorFlow2x:/home/ResNet50-TensorFlow2x -it <Your Image ID> bash
pip install -r requirements.txt
```
### Dockerfile(方法二)
```
cd ResNet50-TensorFlow2x/docker
docker build --no-cache -t ResNet50-TensorFlow2x:latest .
docker run --rm --shm-size 16g --network=host --name=ResNet50-TensorFlow2x --privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/ResNet50-TensorFlow2x:/home/ResNet50-TensorFlow2x -it ResNet50-TensorFlow2x:latest bash
```
### Anaconda(方法三)
1、关于本项目DCU显卡所需的特殊深度学习库可以从开发社社区下载安装:
https://developer.hpccube.com/tool/
```
DTK版本:dtk22.10.1
python: 3.8
tensorflow: 2.9
tf-models-official: 2.7
keras: 2.7
tensorboard: 2.7
```
`Tips:以上dtk、python、tensorflow等DCU相关工具版本需要严格一一对应`
2、其他非特殊库参照requirements.txt安装
```
pip3 install -r requirements.txt
```
## 数据集 ## 数据集
使用ImageNet数据集,并且需要转成TFRecord格式 使用ImageNet数据集,并且需要转成TFRecord格式
ImageNet数据集可以[官网](https://image-net.org/ "ImageNet数据集官网")下载、百度搜索或者联系我们 ImageNet数据集可以[官网](https://image-net.org/ "ImageNet数据集官网")下载、百度搜索或者联系我们
......
FROM image.sourcefind.cn:5000/dcu/admin/base/tensorflow:2.7.0-centos7.6-dtk-22.10.1-py38-latest
ENV DEBIAN_FRONTEND=noninteractive
# RUN yum update && yum install -y git cmake wget build-essential
RUN source /opt/dtk-22.10.1/env.sh
# 安装pip相关依赖
COPY requirements.txt requirements.txt
RUN pip3 install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt --no-deps
numpy==1.21.5
tensorflow_model_optimization
tf-models-official==2.7
psutil
tensorboard==2.7
keras==2.7
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