Open CuongNguyen218 opened 4 years ago
@CuongNguyen218 Hi,
There was a bug in the data augmentation from 26 oct to 4 dec 2019. So you should train it again in this repo.
Also what Darknet-repo and what command do you use to get car_detection AP?
@AlexeyAB , Hi, Thank for your quick reply. Darknet repo what i use to reproduce this result below is Gaussian Yolo Repo ( i used yolo layer not gaussian Yolo Layer). Gaussian Repo: https://github.com/jwchoi384/Gaussian_YOLOv3 and I used official evaluate code from KITTI dataset webpage without any change: http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=2d
Darknet repo what i use to reproduce this result below is Gaussian Yolo Repo
Try to use this repo: https://github.com/AlexeyAB/darknet
I just added ./darknet detector valid
for KITTI and BDD: https://github.com/AlexeyAB/darknet/commit/aaba21bdd336c77561f6c79cb940ef9b52a2b11b
@AlexeyAB , thank for your support but I think there is a misunderstanding between us. Let me explain:
I see it is an unreasonable result follow gaussian paper:
My cmd line is: ./darknet detector valid cfg/datafile cfg/cfgfile weights Maybe i will retry with your newest repo. Thanks
Yes. You should do ./darknet detector valid
on the same repo where did you do ./darknet detector train
There are different resize approaches in different frameworks with pros and cons: https://github.com/AlexeyAB/darknet/issues/232#issuecomment-336955485
Also there was a bug 26 oct -> 4 dec in training: https://github.com/AlexeyAB/darknet/issues/4454#issuecomment-562188010
@AlexeyAB , I will retrain tomorrow. Thanks you. One more question, I want to use GIOU with Gaussian Yolo Layer as a metrics instead of IOU ( do not use GIOU loss). How can I do that ?
@AlexeyAB , Hi i want to read about data augment bug. Maybe you prefer wrong comment above?
I will retrain tomorrow. Thanks you. One more question, I want to use GIOU with Gaussian Yolo Layer as a metrics instead of IOU ( do not use GIOU loss). How can I do that ?
There isn't mAP that is based on GIoU instead of IoU. Try to ask it in GIoU-repository.
Hi i want to read about data augment bug. Maybe you prefer wrong comment above?
Just Bilateral-blurring will be used for 50% of images even if you didn't enable it.
@AlexeyAB ,
In #3114 inyolo_v3_tiny_pan5 matrix_gaussian_GIoU aa_ae_mixup_new.cfg , I saw you use GIOU for Gaussian Yolo layer. I think something not correct when see NLL loss in Gaussian Yolo Paper because NLL loss in Gaussian Yolo Layer is loss function for bounding box and GIOU also Bounding Box loss. Can you explain it for me ?
iou_loss=giou
@CuongNguyen218
GIoU just replaces NLL loss for b-box. So there will be GIoU-loss for bbox-loss and Gaussian_yolo-loss for Uncertainty.
@AlexeyAB , Hi. I think something wrong with valid
I retrained KITTI dataset with your new code and your valid code but something when wrong with car class. The trend is Easy > Moderate > Hard but my result what I get from your code is not follow that. I don't know why ?
@CuongNguyen218
Also you can try to set in your cfg-file
[net]
letter_box=1
Then train usin AlexeyAB repo, and valid by using Jwchoi repo.
@AlexeyAB , Thanks for your support. and i want to find commit of bag of freebie. Can you find it for me?
Serach commit with MixUp.
or just use
[net]
mixup=1
@AlexeyAB , i saw bag_freebies=1
in #3272 . does it equal to mixup = 1
?
Yes.
But you should know, that mixup=1 improves accuracy only for Classifier. (and the use Classifier pre-trained weights file for Detector).
For training Detector is recommended to use mosaic=1
. Use the latest version of Darknet,.
okay, I got it. Thanks you. I want to try it because i see it improve performance of yolov3 in gluoncv +5% on COCO. Paper: https://arxiv.org/pdf/1902.04103.pdf Maybe it included a bag of trick for object detection.
BoF (Bag of Freebies) includes 5 features - there are implemented 5 of 5 features in this repository, read: https://github.com/AlexeyAB/darknet/issues/3272#issuecomment-497149618
There is implemented mixup=1
that gives +1.5 - +2.0% mAP
for Yolov3, but:
mixup=1
for Detector gives only +0.3% mAP@0.5...0.95 on MS COCO
Paper: https://arxiv.org/pdf/1902.04103.pdf
To get +1.5 - +2.0% mAP
you must first train the Classifier with [net] mixup=1
https://github.com/AlexeyAB/darknet/blob/master/cfg/darknet53.cfg and then use this pre-trained weights file for training Detector Yolo with [net] mixup=1
https://github.com/AlexeyAB/darknet/blob/master/cfg/yolov3.cfg then you will get +2% MS COCO
To get another +2.0% you should use: mixup=1, SGDR (cosine lr), random=1, and GPU-processing + CPU-RAM - it takes a lot of time to training.
There are better approaches than MixUP:
@AlexeyAB ,
I retrained my model with your repo and setting letter_box = 1
in my cfg file, and bad results for car class still appear.
This is my result:
What width= and height= do you use in both cfg-files? What random= do you use in the last [yolo] layer in both cfg-files?
Hi @AlexeyAB , I set width = height = 512 in both cfg file. random = 1, ignore_thresh = 0.5 in both.
I retrained my model with your repo and setting letter_box = 1 in my cfg file, and bad results for car class still appear.
Did you set [net] letter_box=1
in cfg, then train with AlexeyAB, then valid with Jwchoi and get Car AP = 59.56%?
Can you attach both cfg-files?
There is also different network resize approaches:
@AlexeyAB
Did you set
[net] letter_box=1
in cfg, then train with AlexeyAB, then valid with Jwchoi and get Car AP = 59.56%?Yes. Here is my both cfg-files? yolov3-kiit-jwchoi.txt yolov3-kitti-AlexeyAB.txt
Did you train both models with the same batch and subdivisions?
batch=64
subdivisions=16
Try to change these lines: https://github.com/AlexeyAB/darknet/blob/318919e1cbb362aac6cb5c3d9388735f9ab594b6/src/detector.c#L169-L171
To these
int dim = (rand() % 10 + 10) * 32;
if (get_current_batch(net)+200 > net->max_batches) dim = 608;
int dim_w = dim;
int dim_h = dim;
recompile and train without letter_box=1
Did you train both models with the same batch and subdivisions?
batch=64 subdivisions=16
Yes, I set both are Batch=64 and sub =16 i will retry this with 10000k iter.
@AlexeyAB , I change these line above and get an error
Maybe related to this line https://github.com/AlexeyAB/darknet/blob/2a873f34485c75d44a346f92ba7dcf2e2aa57a15/src/detector.c#L83
Use if (get_current_batch(net) + 200 > net.max_batches) dim = 608;
instead of if (get_current_batch(net) + 200 > net->max_batches) dim = 608;
Also removes these lines: https://github.com/AlexeyAB/darknet/blob/318919e1cbb362aac6cb5c3d9388735f9ab594b6/src/detector.c#L173-L177
@AlexeyAB This is new error. Here is my change in code. Maybe I miss a '(' right? Sorry i'm not familiar with C
Use //
for commenting instad of #
@AlexeyAB , thank you it work. As I feel, training speed is faster.
@AlexeyAB , I trained my model with 10k iter and finally it works. Thank you for your support.
Hi, if you are using ./darknet detector valid
for kitti, what do you use for eval=
in obj,data? If you are using the devkit to evaluate yolo for kitti, can you please tell me how you are using the devkit? Thanks!
Use eval=kitti
in the obj.data
file.
Can be: voc, coco, imagenet, kitty, bdd: https://github.com/AlexeyAB/darknet/blob/49bff0e24da36f7c1a2471b12089efb27a0173b1/src/detector.c#L662-L708
Hi Alexey, thank you for your response. I did what you said but I get an error while running ./darknet detector valid
where eval = kitti
in obj.data
. The error is this:
To give you an idea of what I did:
Can you please tell me how can I evaluate the model according to kitti 2D detection benchmark?
Can you detect successfully by using your model?
do you have /results/
folder?
do you have folder /results/kitti_results/data/
?
show obj.data
file, did you set eval=kitti
?
show command that you used
Can you successfully run ./darknet detector map ...
on kitti val dataset?
If you can't get Kitti-evalutation, also you can try to use BDD-evalutation methond
eval=bdd in obj.data file
./darknet detector valid cfg/kitty.data cfg/kitty.cfg kitty.weights
try to download gt_KITTI_valid_for_bdd_eval_method.json
from https://github.com/jwchoi384/Gaussian_YOLOv3/tree/master/bdd_evaluation
and try to use this script https://github.com/jwchoi384/Gaussian_YOLOv3/blob/master/bdd_evaluation/evaluate.py
cd bdd_evaluation/
python evaluate.py det gt_KITTI_valid_for_bdd_eval_method.json ../results/bdd_results.json
Hi Alexey,
/results/
folder was already there even before running the training/results/kitti_results/data/
folder when I run ./darknet detector valid
with eval = kitti
in obj.data
but I encounter the error that I mentioned. I only get a single .txt file one of the image file but that .txt file is blank../darknet detector valid data/obj.data cfg/yolo-obj.cfg backup/yolo-obj_final.weights
./darknet detector map ...
and this is what I get after running this:
@AlexeyAB , Hi Alex. Thanks for your amazing code. But I have a trouble when Training your repo with KITTI Dataset. When I use your repo and trained around 50k iter, I get a bad result with car AP detection when test with KITTI Devkit. Details in image below.
And my result at final iter with your repo below And chart image of training process below: I see a gap between the result of car mAP when I use your repo and GaussianYolo repo is large. Notice that I don't use Gaussian Yolo Layer. Result from Gaussian Yolo repo in the image below Can you explain it for me ? This is my config file yolov3-kitti.txt : And this is the number of box of KITTI dataset in training set and test set: