README.md 2.74 KB
Newer Older
maming's avatar
maming committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# ResNet-CBAM

## 项目简介

https://github.com/zhangzhengde0225/binary_distinguish_GRB_by_DL

### 论文

Application of Deep Learning Methods for Distinguishing Gamma-Ray Bursts from Fermi/GBM TTE Data

- https://arxiv.org/abs/2303.00370

### 模型结构

卷积神经网络(CNN)架构的示意图如下。每个卷积块顶部和底部的数字分别表示卷积步幅(默认值为1)和卷积核的数量。图底部的数字描述了特征图的长度和宽度的变化。

![img](https://developer.sourcefind.cn/codes/bw-bestperf/resnet-cbam/-/raw/main/assets/architectures.png)

---

## 环境部署

### 1. 拉取镜像

```bash
maming's avatar
maming committed
26
docker pull image.sourcefind.cn:5000/dcu/admin/base/tensorflow:2.13.1-ubuntu22.04-dtk25.04.2-py3.10
maming's avatar
maming committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
```

### 2. 创建容器

```bash
docker run -it \
--network=host \
--hostname=localhost \
--name=cbam-test \
-v /opt/hyhal:/opt/hyhal:ro \
-v $PWD:/workspace \
--ipc=host \
--device=/dev/kfd \
--device=/dev/mkfd \
--device=/dev/dri \
--shm-size=512G \
--privileged \
--group-add video \
--cap-add=SYS_PTRACE \
-u root \
--security-opt seccomp=unconfined \
maming's avatar
maming committed
48
image.sourcefind.cn:5000/dcu/admin/base/tensorflow:2.13.1-ubuntu22.04-dtk25.04.2-py3.10 \
maming's avatar
maming committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/bin/bash
```

---

## 测试步骤

### 1. 拉取代码

```bash
git clone http://developer.sourcefind.cn/codes/bw-bestperf/resnet-cbam.git
```

### 2. 安装依赖

```bash
pip install matplotlib -i https://mirrors.aliyun.com/pypi/simple/  --trusted-host mirrors.aliyun.com
# 仅需安装matplotlib,也可在../code/model_utils.py 第4行注释掉,不影响程序运行
```

### 3、数据集

```
curl -f -C - -o Binary_Distinguish_GRB_Datasetv1.zip https://wuzh01.hpccube.com:65015/efile/s/d/bWFtaW5nMTAx/775529e4f6b82053  
```

```
Binary_Distinguish_GRB_Datasetv1/data/
└── dataset_256ms/
    ├── test_count_map_256ms.npy
    ├── test_info.npy
    ├── train_count_map_256ms.npy
    ├── train_info.npy
    ├── validate_count_map_256ms.npy
    └── validate_info.npy
└── ......
```

## 训练

```bash
cd /path/your_code_data/code
# 修改数据集路径,train.py 15行
# 查看numa亲和力
export HIP_VISIBLE_DEVICES=0
export TF_XLA_FLAGS=--tf_xla_auto_jit=2
numactl --cpunodebind=3 python train.py
```

## 贡献指南

maming's avatar
maming committed
100
欢迎对ResNet-CBAM项目进行贡献!请遵循以下步骤:
maming's avatar
maming committed
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

1. Fork 本仓库,并新建分支进行功能开发或问题修复。
2. 提交规范的 commit 信息,描述清晰。
3. 提交 Pull Request,简述修改内容及目的。
4. 遵守项目代码规范和测试标准。
5. 参与代码评审,积极沟通改进方案。

---

## 许可证

本项目遵循 MIT 许可证,详见 [LICENSE](./LICENSE) 文件。

---

感谢您的关注与支持!如有问题,欢迎提交 Issue 或联系维护团队。