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

Can not load pretrained YOLOv3-spp weights #1018

Open
YangZhang4065 opened this issue Aug 2, 2018 · 14 comments
Open

Can not load pretrained YOLOv3-spp weights #1018

YangZhang4065 opened this issue Aug 2, 2018 · 14 comments

Comments

@YangZhang4065
Copy link

Hello!
I saw that the spatial pyramid pooling was recently introduced into YOLOV3 and a new pretrained model was uploaded. However when I downloaded weight from https://pjreddie.com/media/files/yolov3-spp.weights and ran
./darknet detect cfg/yolov3-spp.cfg yolov3-spp.weights data/dog.jpg
I got the following error message

   84 Layer before convolutional layer must output image.: File exists
darknet: ./src/utils.c:256: error: Assertion `0' failed.
Aborted (core dumped)

I have no issue running default yolov3 model with the above code.

@crasmuss
Copy link

crasmuss commented Aug 2, 2018

Looking at src/parse.c, this happens because the h and w don't match up for the 4 different layers (82 80 78 77) feeding into the route layer (83) preceding the convolutional layer. In other instances of a route layer having multiple arguments, h and w are the same for the different sources while only c is allowed to differ (and is summed for the output).

Could there have been a change to parsing that wasn't committed along with this new config file?

@nikkymen
Copy link

nikkymen commented Aug 3, 2018

Confirm, the same issue

@pjreddie
Copy link
Owner

pjreddie commented Aug 3, 2018

Sorry, i messed with maxpool layers a bit, should be fixed now from e209b3b

@nikkymen
Copy link

nikkymen commented Aug 3, 2018

@pjreddie

Now it`s works, thank you!

@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 3, 2018

@pjreddie
Does it brake [maxpool]-layer with stride=1 in the yolov3-tiny.cfg?

 l.out_w = (w - size + 1)/stride; 
 l.out_h = (h - size + 1)/stride; 

https://stackoverflow.com/a/37675359/1558037

image

@pjreddie
Copy link
Owner

pjreddie commented Aug 3, 2018

well hm....

@pjreddie
Copy link
Owner

pjreddie commented Aug 3, 2018

I have a fix but i'd have to commit everything i've been working on and i'm not sure if it breaks stuff, let me check

@pjreddie
Copy link
Owner

pjreddie commented Aug 3, 2018

It is distinctly possible that b13f67b fixes this

@AlexeyAB
Copy link
Collaborator

AlexeyAB commented Aug 3, 2018

@pjreddie Thanks

But why is there int w_offset = -pad/2; in the maxpool_layer_kernels.cu

But there is int w_offset = -l.pad/l.stride; in the maxpool_layer.c

AlexeyAB referenced this issue in AlexeyAB/darknet Aug 4, 2018
@trn84
Copy link

trn84 commented Aug 8, 2018

Are you going to update the cfg and weights or are they unaffected?

@smaazs71
Copy link

ERROR :
cifar_small
1
First section must be [net] or [network]: No error
assertion "0" failed: file "./src/utils.c", line 256, function: ### ### error
Aborted (core dumped)

still exist while training cifar

@shouryasimha
Copy link

Hello,
I am trying to train the model using yolov3 with image resolution 200200 and I'm getting no results when I used the yolov3 .cfg after changing the number of classes. If I change the width and height in the config file from 608 * 608 to 200200 respectively, I'm getting an error
87 Layer before convolutional layer must output image.: File exists
darknet: ./src/utils.c:256: error: Assertion `0' failed.

@AlexeyAB
Copy link
Collaborator

@shouryasimha width and height should be multiple of 32 due to 5 subsampling layers. pow(2,5)=32

@shouryasimha
Copy link

shouryasimha commented Mar 22, 2020 via email

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

8 participants