系列文章目录
文章目录
前言
源代码连接https://github.com/eriklindernoren/PyTorch-YOLOv3
当前代码用到的数据集为coco2014,这里提供官网地址https://cocodataset.org/
构建网络模型models.py
代码中构建模型的方法是通过读取config/yolov3.cfg的配置文件,进行搭建的
这里可以通过Netron查看网络结构,由于网络很长,这里只截取了部分结构。
yolov3.cfg中每个层次结构开头对会有[…]来进行说明,当前属于什么网络层次,和一些必要的参数。
[net]
# Testing
#batch=1
#subdivisions=1
# Training
batch=16
subdivisions=1
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.001
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1
[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky
# Downsample
[convolutional]
batch_normalize=1
filters=64
size=3
stride=2
pad=1
activation=leaky
[convolutional]
batch_normalize=1
filters=32
size=1
stride=1
pad=1
activation=leaky.......
这里我们先看utils/parse_config