-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Classifier trainin - Mosaic data augmentation #4432
Comments
@WongKinYiu I also implemented Mosaic data augmentation for Classifier. |
@AlexeyAB no available gpu 🐧🐧🐧 |
@AlexeyAB Hi.
|
May be I would recommend to train the smallest model (for quick comparison) using alternately one approach and compare accuracy %Top1 gain:
|
Every data augmentation method occurs randomly if enabled.
random= and jitter= are used ony from the last [yolo]-layer. |
@AlexeyAB Thanks a lot! |
@AlexeyAB OK, I will do experiments for smallest model first. |
@WongKinYiu Also you can try to train with large mini_batch (if you have 32-256 GB CPU-RAM) #4386 |
@AlexeyAB Hmm... I think my GPU scheduling are full until next year. I will do more comparison if I can borrow more gpus/machines. I think I can do an experiment with large mini_batch using single 1080ti and 64 GB CPU-RAM next week. |
@WongKinYiu If you use CPU-RAM #4386 for increasing mini_batch size, then there is a bottleneck in PCIe, so it doesn't require high-end GPU, you can use GTX 1060/1070. So if you have 128-256 GB CPU-RAM then you can set mini_batch size 4-8x large than on Titan RTX 24 GB or Tesla V100 16/32 GB. |
@AlexeyAB I know, but I would like to make it has only one control factor. |
What is the control factor? |
@AlexeyAB I hope the only difference is mini_batch size, so I want to run the experiment on same machine, same gpu, .... (maybe it is controlled variable?) |
Yes. |
@WongKinYiu Also I added |
@AlexeyAB Hi. |
@Look4-you This thread is for Mosaic data augmentation for Classifier, not for random=, which can be used only for Detector. Create new issue. |
Can I set
|
@WongKinYiu Yes. You can set:
|
@AlexeyAB thank u very much. |
Also try to train Classifier with
but change this line: Line 1631 in b2749c9
to these 2 lines and recompile: const float max_s = max_val_cmp(s1, max_val_cmp(s2, max_val_cmp(s3, s4)));
d.y.vals[i][j] = d.y.vals[i][j] * s1 / max_s + d2.y.vals[i][j] * s2 / max_s + d3.y.vals[i][j] * s3 / max_s + d4.y.vals[i][j] * s4 / max_s; |
Hello, The memory leak problem is very serious when i set
or even
or even disable OPENCV with above setting i try to modify the code https://github.com/AlexeyAB/darknet/blob/master/src/data.c#L1510 |
https://github.com/AlexeyAB/darknet/blob/master/src/data.c#L1531
however, https://github.com/AlexeyAB/darknet/blob/master/src/data.c#L1548
https://github.com/AlexeyAB/darknet/blob/master/src/data.c#L1640
so i change this part from
to
but I think the better way is to make a copy of original mixup mode. |
@WongKinYiu Hi, Thanks! I fixed this bug: b8605bd It seems that mosaic give Top1/Top2 improvement: https://github.com/WongKinYiu/CrossStagePartialNetworks Also did you try to use mosaic with such modification? #4432 (comment) |
Are you planning to use I didn't find very simple solution for this.
|
@AlexeyAB Thanks, currently i also do not find a good way to deal with it. |
Anyway, for significant optimization, you should use |
#4432 (comment) got nan |
Hi @AlexeyAB, I think there might be a bug with My config has the following Testing#batch=1 Trainingbatch=64 Is mosaic supposed to work with detectors or only for classifiers? From the top discussion it looks like it should work? Thanks! |
|
Related to: #4264
Use for Classifier training:
cutmix=1
- will be used CutMix (36%-91%, 9%-64%) Classifier - CutMix: Regularization Strategy to Train Strong Classifiers #4419mosaic=1
- will be used Mosaic data augmentation (4%-64%, 4%-64%, 4%-64%, 4%-64%)Run training with flag
-show_imgs
to see how images are changed (in separate windows and saved to filesaug_... .jpg
) and how labels are changed (see the console).The text was updated successfully, but these errors were encountered: