pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.87k stars 21.33k forks source link

Can not load pretrained YOLOv3-spp weights #1018

Open YangZhang4065 opened 6 years ago

YangZhang4065 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Confirm, the same issue

pjreddie commented 6 years ago

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

nikkymen commented 6 years ago

@pjreddie

Now it`s works, thank you!

AlexeyAB commented 6 years ago

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

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

image

pjreddie commented 6 years ago

well hm....

pjreddie commented 6 years ago

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 commented 6 years ago

It is distinctly possible that b13f67bfdd87434e141af532cdb5dc1b8369aa3b fixes this

AlexeyAB commented 6 years ago

@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

trn84 commented 6 years ago

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

smaazs71 commented 5 years ago

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 commented 4 years ago

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 200*200 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 commented 4 years ago

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

shouryasimha commented 4 years ago

I have tried with a multiple of 32 , i gave the value as 224 for width and height but my model is failing to recognize any object. getting my IOU = -nan i edited the config file as follows: number of class = 6 steps =12000 filters =33 width = 224 height = 244 and my image width and height are 200 * 200 respectively.

Kindly help me solve this issue.

On Fri, Mar 20, 2020 at 9:43 PM Alexey notifications@github.com wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/1018#issuecomment-601975429, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2F2HZ7Y67JLXL6FAW2LRIQLV3ANCNFSM4FNOWBZQ .