Closed MostafaMohamedEr closed 3 years ago
@AlexeyAB Any suggestions?
Try to follow this FAQ: https://github.com/AlexeyAB/darknet/wiki/FAQ---frequently-asked-questions#1-i-get-low-accuracy
你有看控制台上计算map的结果吗,我碰到你类似的问题,观察训练时控制台输出计算map的结果发现有些类别的ap为0,不知道你是不是同样的问题?
@AlexeyAB Any suggestions? @AlexeyAB I did all the instructions, there were some images with missing annotations, i deleted it and i viewed the images using yolo_Mark and deleted all wrong samples. Then i added negative samples images. Then i trained the yoloV3 model on 1k accuracate images and 3k accurate images. All these training experiments produced low mAP I am really confused, I tried everything. mAP didn't exceed 50%. I tried training YOLOV4 with the same data it gets 72% mAP, but didn't improve along with the training. i don't know why.
./darknet detector calc_anchors data/obj.data -num_of_clusters 9 -width 608 -height 608 -show
你有看控制台上计算map的结果吗,我碰到你类似的问题,观察训练时控制台输出计算map的结果发现有些类别的ap为0,不知道你是不是同样的问题? I train a model on detecting pedestrians, so i have only one class to detect (person), So no there is no 0AP for the person class When i use darknet map i get slightly higher mAP, but no 0AP. here is a a sample from my list trained I
* Show 2 outputs for ./darknet detector map .. for training and validation datasets for both yolov3 and yolov4
First, Thanks sir for your interest This is YoloV3 Output YoloV4Output
* Attach cfg-files in zip/txt format
* Show detection results on 3 images: training, validation, any 3rd party from real case
Using YOLOV3 Train Image Test Image Real Image
* Do this command, don't use this anchor, just show me the point cloud: `./darknet detector calc_anchors data/obj.data
@AlexeyAB -num_of_clusters 9 -width 608 -height 608 -show` Anchors using 608 Anchors using 416, as i train using 416 IF you need to see the data i will download the data from the drive in 5 min and upload the anchors
* Show 2 outputs for ./darknet detector map .. for training and validation datasets for both yolov3 and yolov4
First, Thanks sir for your interest This is YoloV3 Output YoloV4Output
Is it for validation dataset?
Can you set valid=train.txt
in obj.data
file and calc mAP for these 2 models?
@AlexeyAB Here are the map for training imgs YoloV3
YoloV4 (Note: YoloV4 was trained for 3000 correct images that 1000 training images are proportion)
Did you use such training command?
./darknet detector train /content/Person.data /content/yolov4.cfg yolov4.conv.137 -map -dont_show -ext_output -clear
And this pretrained weights file? https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4.conv.137
If yes, then there are several solutions:
[net] max_batches=12000
and increase steps in cfgAlso:
Train and use yolov4-csp.cfg
with resolution 640x640 with this pre-trained weights https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-csp.conv.142
Train https://raw.githubusercontent.com/AlexeyAB/darknet/master/cfg/yolov4-p5-frozen.cfg 896x896 (download the latest Darknet version, I just fixed it 1 day ago) with this pre-trained weights https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-p5.conv.232
Did you use such training command?
./darknet detector train /content/Person.data /content/yolov4.cfg yolov4.conv.137 -map -dont_show -ext_output -clear
And this pretrained weights file? https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4.conv.137 Yes, i did There is no chance to increase the accuracy of yoloV3, as i am working on social distancing and fps is important? is there any news about yoloWithLstm Tracker, I am waiting for the improvements
Collect more training data
try to train longer, for
[net] max_batches=12000
and increase steps in cfgTry to train and use with higher resolution 608x608
I will try these steps and provide a feedback, thanks and sry for disturb
Can you show mAP for valid dataset for network resolution for yolov4.cfg (and you already trained weights)?
If the mAP is higher than in v3, then just use v4 with lower resolution if you need speed. Another way, just try to use OpenCV (compiled with CUDA/cuDNN) for inference, it can be 1.5 - 3x faster than Darknet:
If the mAP is higher than in v3, then just use v4 with lower resolution if you need speed. Another way, just try to use OpenCV (compiled with CUDA/cuDNN) for inference, it can be 1.5 - 3x faster than Darknet:
Yes i installed openCV 4.5.1 WIth GPU, i get 15 FPS with yolo V3 using gtx1050 4GB, but i haven't tried yoloV4, and i haven't implemented tracking yet
Edit: I trained a yoloV4 on the last 1k training set for 3000 batches: it produced 75mAP for 608 with 19sec, 72 for 382 with 13 sec on colab pro Here are the results 608
384
352
How many sec do you get by using v3 416x416?
I mean that you can use YOLOv3/v4 directly in OpenCV without Darknet, and it can be faster: https://github.com/AlexeyAB/darknet/issues/7841#issuecomment-871642578
How many sec do you get by using v3 416x416?
I mean that you can use YOLOv3/v4 directly in OpenCV without Darknet, and it can be faster: #7841 (comment) Oh, i got it. I tried yolo V3 416 on the darknet, it resulted in same time of yoloV4 382, but Yolo V4 is more accurate
and, i tried the both on opencv.DNN there was slight difference, i will use yoloV4 with lower dimensions , thanks for the advice
YoloV3 using openCV
yoloV4 using openCV
i hope getting better accuracy
Try to use cv::dnn::DNN_BACKEND_CUDA
and cv::dnn::DNN_TARGET_CUDA_FP16
in OpenCV-dnn
FP16 Using FP16 disable GPU , i don't know why, i use same without FP16
@AlexeyAB I don't think the loss will decrease more than that, should i decrease the learning rate? ( i trained it for more than 10k iteration, and it stuck between 1.8 and 2.0) There is a thing, i don't know is it a bug or a problem with my files, using ./darknet detector gets a different score than plotted while training, as i got 74mAP, but plotted as 65
The problem is solved by increasing the number of training images and deleting bad annotated images
你有看控制台上计算map的结果吗,我碰到你类似的问题,观察训练时控制台输出计算map的结果发现有些类别的ap为0,不知道你是不是同样的问题?
你好,我遇到的跟你描述的一样,我的两个类别,但是其中一个ap为0,不知道为啥?请问怎么解决呢?谢谢!
我后面发现是数据的问题,你可以训练的时候加一个-show_imgs看看能不能看到你的标注框,如果不能看到说明是数据出了问题,我检查的结果是我的标签没对上。
在 2021-07-09 15:25:42,"1343464520" @.***> 写道:
你有看控制台上计算map的结果吗,我碰到你类似的问题,观察训练时控制台输出计算map的结果发现有些类别的ap为0,不知道你是不是同样的问题?
你好,我遇到的跟你描述的一样,我的两个类别,但是其中一个ap为0,不知道为啥?请问怎么解决呢?谢谢!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
谢谢回复。我尝试了单独去训练ap为0的那一类,训练是正常的,ap都能到99,测试也正常,就是把两类数据一起训练就不行。不知道啥原因
---Original--- From: @.> Date: Fri, Jul 9, 2021 17:27 PM To: @.>; Cc: @.**@.>; Subject: Re: [AlexeyAB/darknet] Low loss and Low mAP for YoloV3 (#7841)
我后面发现是数据的问题,你可以训练的时候加一个-show_imgs看看能不能看到你的标注框,如果不能看到说明是数据出了问题,我检查的结果是我的标签没对上。
在 2021-07-09 15:25:42,"1343464520" @.***> 写道:
你有看控制台上计算map的结果吗,我碰到你类似的问题,观察训练时控制台输出计算map的结果发现有些类别的ap为0,不知道你是不是同样的问题?
你好,我遇到的跟你描述的一样,我的两个类别,但是其中一个ap为0,不知道为啥?请问怎么解决呢?谢谢!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Used: Command !./darknet detector train /content/Person.data /content/yolov3.cfg /content/realyolo.weights -map -dont_show -ext_output -clear
My Dataset 1500 instances of ImageNet person class, after removing misleading photos using pretrained model coco to detect images with low predictions and wrong annotations
what Loss and mAP did you get? loss 0.66 with 44 mAP