AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.66k stars 7.96k forks source link

Erroe while calculating anchors on colab #5212

Open shouryasimha opened 4 years ago

shouryasimha commented 4 years ago

Hello, I tried to calculate anchors and getting this error on colab, i changed the makefile i.e. gpu=1,opencv=1,cud_nn=1. Kindly help me solve this issue. image

2)My images have resolution 200x200, can you please tell me is it better to set the width and height as close as possible to 200 for detecting objects or is it better to use default yolov3.cfg i.e. width and height = 608. I have tried many ways but two classes are not getting detected as the same to be very minute and my region-106 is mostly nan. Any tips on improving my model, such as changing the ignore_threshhold or jitter . the default values for them are 0.7 and 0.3 respectively.

Please find the images of classes that are not being detected... I have 300 images for each class and total of 1800 images for 6 classes. I split them with 290 images for training and 10 images for testing from each class. Crazing crazing_1 rolled-in_scale rolled-in_scale_10

AlexeyAB commented 4 years ago

Yes, use 224x224 in both calc_anchors and in your cfg-file

shouryasimha commented 4 years ago

image should the images and labels be in the same folder?

AlexeyAB commented 4 years ago

You should run it from bash rather than from python

shouryasimha commented 4 years ago

I stopped the calculation as it was too long.. is it okay because it took more than 15 minutes.. Is the result correct? if it is, how do spread it among the 3 layers? you said anything above 60x60 should be in first and so on, arent most of my anchors greater than 30x30 and would that mean my last layer has no anchors associated? or should i leave the defaults masks as it is and just change the anchors? image

shouryasimha commented 4 years ago

@AlexeyAB I figured out the training and thank you so much for your repo. Can you please tell me how to plot a loss graph for a better understanding of the value after training?

shouryasimha commented 4 years ago

@AlexeyAB Hi , I have a couple of questions, please forgive if they are too naive, as I have just started. 1) my model was unable to detect the small features in my images when compared to others? 2) I was unable to see the bbox coordinates for any of the detections while testing? is it because of the edited detector.c? I could only see the objectness %. 3) would training the with yolove_spp.cfg with an increased resolution like 608x608 give better results? 4)I'm training my model on google colab the command -mjpeg_port 8080 didn't result in the chart as google colab uses a proxy server. Can you please help me plot the loss chart? 5) my loss has only decreased from 0.7 to 0.48 in 3000 iterations i.e. from 9000-12000(max_batches=12000) image this was the result obtained and I would like to increase the detection of crazing and rolled-in_sclae? can you tell me if its overfitting or underfitting? if so, how did you come with that conclusion and how can I solve that issue?

AlexeyAB commented 4 years ago

If you use default jitter/hue/saturation/exposure and at least 200 images per class then there can't be overfitting.

Just add more images. And/or train with higher width=608 height=608

shouryasimha commented 4 years ago

On Tue, Apr 14, 2020 at 1:44 PM Alexey notifications@github.com wrote:

If you use default jitter/hue/saturation/exposure and at least 200 images per class then there can't be overfitting.

Just add more images. And/or train with higher width=608 height=608

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/AlexeyAB/darknet/issues/5212#issuecomment-613583426, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALKV2F4AK7OOGMY7O6TSAMTRMSOIBANCNFSM4MGDDHTQ .

I have 290 images per class and do you think training a model with 608x608 and giving the pre-trainer weights from the model 224x224 would work?

shouryasimha commented 4 years ago

@AlexeyAB Sorry to bother you again. When using image I only get the object% but no bounding box coordinates. And also can you please tell me would training with yolov3_spp give better results? image

AlexeyAB commented 4 years ago

use flag -dont_show at the end of command

shouryasimha commented 4 years ago

image I'm still getting only the object % , image i need the bounding box-coordinates but only get the class_confidence %

AlexeyAB commented 4 years ago

Use also flag -ext_output https://github.com/AlexeyAB/darknet#how-to-use-on-the-command-line

shouryasimha commented 4 years ago

@AlexeyAB got it. I have tried increasing the number of anchors to 12 by allocating 4 anchors to each yolo layers but get an error. Any way that I can do that? image These are my anchors calculated as they give better avg_IOU=72.17 image