Hello,
I am trying to launch a training process on Yolo v3 but I got an error before the training start. The test seems to work (with the dog image in data/).
my image folder is as follow :
data/raton/train/ and data/raton/test where each folder has images 0.jpg 1.jpg etc and label files 0.txt etc .
train.txt and test.txt have the path of my images like : data/raton/train/0.jpg ... etc
I also modified the number of output as I have one class, filters = 18
When I use this command line :./darknet detector train files/obj.data files/yolov3.cfg yolov3.weights I get this error:
87 Layer before convolutionnal layer must output image.: Success
darknet: ./src/utils.c:256: error: Assertion '0' failed.
Aborted (core dumped)
I do not understand why and what is the problem. Do someone already have this problem ?
Hello,
Why don't you use the darknet53.conv.74 to train you custom dataset?
The yolov3.weights is for 80 classes on COCO I guess. I think you should follow the instructions at https://pjreddie.com/darknet/yolo/
For the yolov3.cfg file, did you also modify the number of classes in it? Since number of your output is only 1, please set the classes in your yolov3.cfg equal to 1 (classes=1).
Hope this help!
@huuquan1994 tthank you for the reply ! The problem came from the subdivision parameters which was commented ahd the size of the image. Depending of the size, I have the error. For example 800x 800 is fine but 400x400 not. I have always a problem if I want to use the yolov3.Weight. There is no error but darknet save directly the weight. "saving weights to backup ...". It doesn't seems the case with the darknet53.conv.74. I would like to use the yolov3.weight because I wanted to use transfer learning from a model which have learnt on coco dataset.
@Shiro-LK I also use yolov3.weight as a pretrain model , darknet save directly the weight. "saving weights to backup ..." too. how did you fix this problem?
@Shiro-LK I also use yolov3.weight as a pretrain model , darknet save directly the weight. "saving weights to backup ..." too. how did you fix this problem?
Hi, the yolov3.weights file doesn't work. Use the file 'darknet53.conv.74' as mentioned by @huuquan1994
I met the same problem.After trying a lot , it is suggested to make the picture's width and height smaller,such as 512 * 512.
Hope it helps you.
Hello
I am trying to train 50 * 50 images with 4 classes
And using darknet53.conv.74 as weight with yolov3-tiny.cfg
so i want to train faster, so reduce the image size in yolov3-tiny.cfg as 104 * 104
After that it got like this error
How can i fix this error?
D:\git\darknet\build\darknet\x64>darknet_no_gpu.exe detector train data/YOLOv3.data data/yolov3-tiny.cfg data/darknet53.conv.74
yolov3-tiny
layer filters size/strd(dil) input output
0 conv 16 3 x 3/ 1 104 x 104 x 3 -> 104 x 104 x 16 0.009 BF
1 max 2x 2/ 2 104 x 104 x 16 -> 52 x 52 x 16 0.000 BF
2 conv 32 3 x 3/ 1 52 x 52 x 16 -> 52 x 52 x 32 0.025 BF
3 max 2x 2/ 2 52 x 52 x 32 -> 26 x 26 x 32 0.000 BF
4 conv 64 3 x 3/ 1 26 x 26 x 32 -> 26 x 26 x 64 0.025 BF
5 max 2x 2/ 2 26 x 26 x 64 -> 13 x 13 x 64 0.000 BF
6 conv 128 3 x 3/ 1 13 x 13 x 64 -> 13 x 13 x 128 0.025 BF
7 max 2x 2/ 2 13 x 13 x 128 -> 7 x 7 x 128 0.000 BF
8 conv 256 3 x 3/ 1 7 x 7 x 128 -> 7 x 7 x 256 0.029 BF
9 max 2x 2/ 2 7 x 7 x 256 -> 4 x 4 x 256 0.000 BF
10 conv 512 3 x 3/ 1 4 x 4 x 256 -> 4 x 4 x 512 0.038 BF
11 max 2x 2/ 1 4 x 4 x 512 -> 4 x 4 x 512 0.000 BF
12 conv 1024 3 x 3/ 1 4 x 4 x 512 -> 4 x 4 x1024 0.151 BF
13 conv 256 1 x 1/ 1 4 x 4 x1024 -> 4 x 4 x 256 0.008 BF
14 conv 512 3 x 3/ 1 4 x 4 x 256 -> 4 x 4 x 512 0.038 BF
15 conv 27 1 x 1/ 1 4 x 4 x 512 -> 4 x 4 x 27 0.000 BF
16 yolo
[yolo] params: iou loss: mse, iou_norm: 0.75, cls_norm: 1.00, scale_x_y: 1.00
17 route 13
18 conv 128 1 x 1/ 1 4 x 4 x 256 -> 4 x 4 x 128 0.001 BF
19 upsample 2x 4 x 4 x 128 -> 8 x 8 x 128
20 route 19 8
21 Layer before convolutional layer must output image.: No error
Late to the party but I believe the problem is... You can set the width and height to be 800x800 but not 400x400 because 800 is evenly divisible by 32 and 400 is not. You can try 448 or 416 as a weight/height parameter to fix your problem. When the downsampling starts to occur you get uneven downsamples which causes size mismatches when combing layers. So just make your input size a multiple of 32 (maybe 16...but 32 at least works for me).
I have the same error. I am using darknet53.conv.74 for weights. I have 13 classes and I have updated the cfg file accordingly. I also changed the weight and height to 800,800. The error still persists.
Most helpful comment
Late to the party but I believe the problem is... You can set the width and height to be 800x800 but not 400x400 because 800 is evenly divisible by 32 and 400 is not. You can try 448 or 416 as a weight/height parameter to fix your problem. When the downsampling starts to occur you get uneven downsamples which causes size mismatches when combing layers. So just make your input size a multiple of 32 (maybe 16...but 32 at least works for me).