Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does making anchor larger than 60 x 60 mean? #3372

Closed
LukeAI opened this issue Jun 10, 2019 · 6 comments
Closed

What does making anchor larger than 60 x 60 mean? #3372

LukeAI opened this issue Jun 10, 2019 · 6 comments

Comments

@LukeAI
Copy link

LukeAI commented Jun 10, 2019

recalculate anchors for your dataset for width and height from cfg-file: darknet.exe detector calc_anchors data/obj.data -num_of_clusters 9 -width 416 -height 416 then set the same 9 anchors in each of 3 [yolo]-layers in your cfg-file. But you should change indexes of anchors masks= for each [yolo]-layer, so that 1st-[yolo]-layer has anchors larger than 60x60, 2nd larger than 30x30, 3rd remaining. Also you should change the filters=(classes + 5)* before each [yolo]-layer. If many of the calculated anchors do not fit under the appropriate layers - then just try using all the default anchors.

What does this mean? How can I assert that an anchor pair is larger than 60x60?

My first yolo layer calculated anchors are:
mask = 6,7,8
anchors = 11, 31, 25, 48, 15,115, 43, 78, 36,228, 75,110, 93,172, 109,263, 165,316

93, 172, 109, 263, 165, 316 are all larger than 60 - does that mean they satisfy the guidelines in the readme?

@AlexeyAB
Copy link
Owner

My first yolo layer calculated anchors are:
mask = 6,7,8
anchors = 11, 31, 25, 48, 15,115, 43, 78, 36,228, 75,110, 93,172, 109,263, 165,316

4 anchors larger than 60x60, for example 36x228=8208 > 60x60=3600,
so should be mask = 5,6,7,8

@LukeAI LukeAI closed this as completed Jun 10, 2019
@LukeAI
Copy link
Author

LukeAI commented Jun 10, 2019

So my final Yolo layer should just have mask=0 because it is the only pair smaller than 30x30?

Does this apply in the same way if training with letter_box?

@LukeAI
Copy link
Author

LukeAI commented Jun 10, 2019

Having made the changes, this error occurs at the first yolo layer:

Error: l.outputs == params.inputs
filters= in the [convolutional]-layer doesn't correspond to classes= or mask= in [yolo]-layer

[convolutional]
size=1
stride=1
pad=1
filters=36
activation=linear

[yolo]
mask = 5,6,7,8
anchors = 11, 31,  25, 48,  15,115,  43, 78,  36,228,  75,110,  93,172, 109,263, 165,316
classes=7
num=9
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

But filters is correct according to: filters = (classes + 5) * num / number_of_yolo_layers

Where have I gone wrong? :o

@LukeAI
Copy link
Author

LukeAI commented Jun 11, 2019

@AlexeyAB any help? :/

@AlexeyAB
Copy link
Owner

But filters is correct according to: filters = (classes + 5) * num / number_of_yolo_layers

in general
filters=(classes + 5) * num_of_masks = (7+5) * 4 = 48

@duohappy
Copy link

My first yolo layer calculated anchors are:
mask = 6,7,8
anchors = 11, 31, 25, 48, 15,115, 43, 78, 36,228, 75,110, 93,172, 109,263, 165,316

4 anchors larger than 60x60, for example 36x228=8208 > 60x60=3600,
so should be mask = 5,6,7,8

hi, @AlexeyAB
36 × 228 = 2208 > 60 × 60,the anchors such as 36, 228 75,110, 93,172, 109,263, 165,316 statify the condition,mask = 4,5,6,7,8.

36 < 60, so the anchor 36, 228 is excluded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants