README.md 1.19 KB
Newer Older
huchen's avatar
huchen committed
1
2


3
# YOLOV5算力测试
huchen's avatar
huchen committed
4

5
## 测试前准备
huchen's avatar
huchen committed
6

7
### 数据集
huchen's avatar
huchen committed
8

9
使用COCO2017数据集
huchen's avatar
huchen committed
10

11
### 环境搭建
huchen's avatar
huchen committed
12

13
建立python3.7的环境
huchen's avatar
huchen committed
14
15

```
16
conda create -n yolov5 python='3.7'
huchen's avatar
huchen committed
17

18
conda activate yolov5
huchen's avatar
huchen committed
19
20
```

21
安装python依赖包
huchen's avatar
huchen committed
22
23

```
24
25
26
27
28
29
30
31
pip3 install PyYAML>=5.3.1
pip3 install tqdm>=4.41.0
pip3 install opencv-python>=4.1.2
pip3 install pandas>=1.1.4
pip3 install requests>=2.23.0
pip3 install matplotlib>=3.2.2
pip3 install seaborn>=0.11.0
pip3 install tensorboard>=2.4.1
huchen's avatar
huchen committed
32
33
```

34
35
```
pip3 install torch-1.10.0a0+git450cdd1.dtk22.4-cp37-cp37m-linux_x86_64.whl -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
huchen's avatar
huchen committed
36

37
pip3 install torchvision-0.10.0a0_dtk22.04_300a8a4-cp37-cp37m-linux_x86_64.whl -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
huchen's avatar
huchen committed
38

39
40
pip3 install pycocotools -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
```
huchen's avatar
huchen committed
41

42
## 训练
huchen's avatar
huchen committed
43

44
45
46
```
export HSA_FORCE_FINE_GRAIN_PCIE=1
export MIOPEN_FIND_MODE=3
huchen's avatar
huchen committed
47

48
49
python3 train.py --data data/coco.yaml --cfg models/yolov5x.yaml --weights weights/yolov5x.pt --device 0 --batch-size 32 --epochs 10
```
huchen's avatar
huchen committed
50

51
## 精度测试
huchen's avatar
huchen committed
52

53
54
55
```
python3 val.py --data data/coco-v5.yaml --weights runs/train/exp12/weights/best.pt --device 0
```
huchen's avatar
huchen committed
56