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

Why should this line "assert(l.outputs == params.inputs) " in line 281 of parser.c #236

Closed
MaeThird opened this issue Oct 6, 2017 · 14 comments

Comments

@MaeThird
Copy link

MaeThird commented Oct 6, 2017

What's the job of this assert assert(l.outputs == params.inputs) in line 281 of parser.c ?
In my opinion the parse_region is doing the assembling works of the regional proposal layer,in which the output is ordinarily as number_of_proposes*(classes + coordinates +1),although in convolutional_layer the output is ordinarily calculated as h*w*filters.
I mean there is no logical equal between input size and output size of regional proposal layer.
Can any explanation ?

@MaeThird MaeThird closed this as completed Oct 7, 2017
@jktzes
Copy link

jktzes commented Mar 28, 2018

Hi there! Did you by any chance solve the problem? @MaeThird

@ahsan856jalal
Copy link

@MaeThird @jktzes According to my personal experience
If you are using yolov3:
This error happens when your filter value is wrong in any of the convolution layer before [yolo] layer
It should be = num/3*(classes+5)
If you are using yolov2:
This error happens when your filter value in convolution layer before region layer is wrong
It should be = num*(classes+5)

@dee6600
Copy link

dee6600 commented May 10, 2018

what is "num"???

@peymanmortazavi
Copy link

@dee6600 It's set in your configuration file. For yolo3 the default the 9 but you can change this depending on your needs.

@dee6600
Copy link

dee6600 commented May 14, 2018

I am working with yolov2, For three categories. so, filters = (3+5)*5 seems to work.
@peymanmortazavi its okay to set "num"in config file. But can anyone tell me what its meaning? does it change over number of categories(wild guess).

@TheMikeyR
Copy link

@dee6600 num is the amount of anchor-pairs, so if you increase the amount of anchors you should increase num as well.

@dee6600
Copy link

dee6600 commented May 14, 2018

@TheMikeyR thank you for insight. But i am kind of noob here hehe. I dont know what is anchor-pairs.

@TheMikeyR
Copy link

@dee6600
#568

@Dantetheash
Copy link

Hello there,
I am facing the same problem but I am using Yolo-LITE what should be my filter function?
@ahsan856jalal

@colorfuldarkgray
Copy link

colorfuldarkgray commented Apr 20, 2019

I thought num was the number of classes that can overlap in one window. After reading #568 I think its a new concept replacing simple grid used in yolo v1.

@KanchanIIT
Copy link

in the yolov3-voc.cfg file there are three [yolo] block. you have to change the filter size for each of the [convolutional] block filter size before all the three [yolo] block as follow -
filter size=(num/3)*(classes+5)
In my case, as the classes are 1 and num=9 so the filter size is 18.

[convolutional]
size=1
stride=1
pad=1
filters=18
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=1
num=9

jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

@YongLAGCC
Copy link

In your .cfg make sure the "classes = num of your trained object" in each layers

@Shruthi-Sampathkumar
Copy link

Shruthi-Sampathkumar commented Aug 1, 2019

in the yolov3-voc.cfg file there are three [yolo] block. you have to change the filter size for each of the [convolutional] block filter size before all the three [yolo] block as follow -
filter size=(num/3)*(classes+5)
In my case, as the classes are 1 and num=9 so the filter size is 18.

[convolutional]
size=1
stride=1
pad=1
filters=18
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=1 num=9
jitter=.3
ignore_thresh = .5
truth_thresh = 1
random=1

Hi. I am using Yolov3.
My number of classes is 4. So (num/3)*(number_of_classes+5) = 27. Even after this modification in thr yolov3-voc.cfg file, I am getting the error " darknet: ./src/parser.c:315: parse_yolo: Assertion `l.outputs == params.inputs' failed ". What can I do to solve this?

@OctaM
Copy link

OctaM commented Aug 29, 2019

If your try to run the training from terminal, after you've changed the filters and classes, try to exit the terminal and start it again. It may work like that. And do not forget to save the changes that you made in .cfg file

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