yolo-v3学习2

cfg文件夹下,
.cfg 一些网络结构,以alexnet.cfg为例,简直太奇葩了,我以前从没见过这样写网络结构的。(我一定是见识太少了。。)

[net]
batch=128
subdivisions=1
height=227
width=227
channels=3
momentum=0.9
decay=0.0005
max_crop=256

learning_rate=0.01
policy=poly
power=4
max_batches=800000

angle=7
hue = .1
saturation=.75
exposure=.75
aspect=.75

[convolutional]
filters=96
size=11
stride=4
pad=0
activation=relu

[maxpool]
size=3
stride=2
padding=0

[convolutional]
filters=256
size=5
stride=1
pad=1
activation=relu

[maxpool]
size=3
stride=2
padding=0

[convolutional]
filters=384
size=3
stride=1
pad=1
activation=relu

[convolutional]
filters=384
size=3
stride=1
pad=1
activation=relu

[convolutional]
filters=256
size=3
stride=1
pad=1
activation=relu

[maxpool]
size=3
stride=2
padding=0

[connected]
output=4096
activation=relu

[dropout]
probability=.5

[connected]
output=4096
activation=relu

[dropout]
probability=.5

[connected]
output=1000
activation=linear

[softmax]
groups=1

[cost]
type=sse

yolov3.cfg:

[net]
# Testing
batch=1
subdivisions=1
# Training
# batch=64
# subdivisions=16
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.0001
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

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear
    ...
[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

[shortcut]
from=-3
activation=linear

######################

[convolutional]
batch_normalize=1
filters=512
size=1
stride=1
pad=1
activation=leaky
    ...
[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 6,7,8
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=80
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 61

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky
    ...
[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 3,4,5
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=80
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 36

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky
    ...
[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 0,1,2
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=1  # modified by zq
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

不能可视化,好麻烦。。盗here的一张图

基础网络是一个类似resnet的结构,重点关注route和yolo层。
route层,相当于concat层。 (参考route layer
yolo层:

[yolo]
mask = 6,7,8
anchors = 10,13,  16,30,  33,23,  30,61,  62,45,  59,119,  116,90,  156,198,  373,326
classes=80
num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

.data/.dataset 是一些参数路径配置,coco.data如下:

classes= 80
train = /home/pjreddie/data/coco/trainvalno5k.txt
#valid  = coco_testdev
valid = data/coco_val_5k.list
names = data/coco.names
backup = /home/pjreddie/backup/
eval=coco

src文件夹 .c和.h文件,是一些层。其中包括yolo_layer.h和yolo_layer.c
作者用的网络框架是他自己写的,见darknet,纯C实现,支持CPU/GPU。应该嵌入式友好。相关中文资料

猜你喜欢

转载自blog.csdn.net/u012420309/article/details/79995251