Open clydebailey opened 6 years ago
@clydebailey Hi,
Just try to set binary=1
instead of xnor=1
in the [convolutional]
layers in cfg-file.
But I didn't test it well.
@AlexeyAB Ok I will try that .
@clydebailey Hi,
Can you share details on how you trained yolov2-tiny XNOR network for single class? I am also trying to train Tiny-Yolov2 XNOR net, but so far I got only ~27% mAP in VOC test set. Here is my mAP results.
@ghimiredhikura Do you use this cfg-file? https://github.com/AlexeyAB/darknet/blob/master/cfg/tiny-yolo_xnor.cfg
Hello @AlexeyAB,
I am training in voc dataset, so I used tiny-yolo_xnor-train.txt My voc.data file: voc.data.txt
Training command
darknet.exe detector train XNOR/voc.data XNOR/tiny-yolo_xnor-train.cfg XNOR/yolov2-tiny-voc.conv.13 -map
@ghimiredhikura
How many iterations did you train?
Also you can try to use this XNOR-cfg file (there are only 3 XNOR layers): yolov2-tiny_obj_xnor_fp32.cfg.txt
@AlexeyAB
- How many iterations did you train?
I did train more then 200000 iterations.
- Also you can try to use this XNOR-cfg file (there are only 3 XNOR layers): yolov2-tiny_obj_xnor_fp32.cfg.txt
This way, I think mAP will be improved, but I am trying to train network similar to this one for hardware implementations. A Lightweight YOLOv2: A Binarized CNN with A Parallel Support Vector Regression for an FPGA Therefor I can't use only 3 layers as XNOR layers.
As I also trained darknet19 classifier in XNOR #2062 form, but still no luck yet!
Any suggestions please!
@ghimiredhikura
If I understand correctly, they try to use network like this: yolov2_xnor_fpga.cfg.txt - try to train this model.
This is hybrid of yolov2.cfg and yolov2-tiny.cfg. With only 1st and two last float layers, other XNOR layers.
Also check that you uncommented difficult
in the voc.data
file before doing ./darknet detector map
...:
classes= 20
train = data/train_voc.txt
valid = data/2007_test.txt
difficult = data/difficult_2007_test.txt
names = data/voc.names
backup = backup/
@AlexeyAB,
Thank you for your quick response. Now I am training network as you suggested. I used pretrained weights from darknet19 classifier.
Here is the training progress after ~50000 iterations! mAP is just 1%!
@ghimiredhikura
Update your code from Github. And recompile.
Download this weights: http://pjreddie.com/media/files/yolov2-voc.weights
Do:
./darknet partial cfg/yolov2-voc.cfg yolov2-voc.weights yolov2.conv.23 23
And train using yolov2.conv.23
pre-trained weights file.
@AlexeyAB,
Updated code from Github and run training over the weekend using yolov2.conv.23 extracted from http://pjreddie.com/media/files/yolov2-voc.weights.
Here is training result and mAP status: Although in training graph, the mAP seems to be wrong, I calculated mAP using light_yolo repo (ofcourse using latest weights), but unfortunately it is still very low!
@ghimiredhikura There is a bug in mAP calculation during Training if is used CUDNN=1. I will solve it.
Also what GPU do you use? And did you set CUDNN_HALF=0 in the Makefile?
My gpu is 1080 ti. And training in Win 10 with visual studio.
@ghimiredhikura
I added fix. I hope now mAP calculation during Training is fixed. Update your code from GitHub.
I calculated mAP using light_yolo repo (ofcourse using latest weights), but unfortunately it is still very low!
I do not know why this is so. Try to use this cfg-file, I modified it: yolov2_xnor_fpga.cfg.txt And try to train it until mAP stops.
@AlexeyAB I was training with updated code and new cfg file you attached above, but mAP is still very low!
@ghimiredhikura Hi,
What mAP can you get by using command ./darknet detector map cfg/voc.data yolov2_xnor_fpga.cfg backup/yolov2_xnor_fpga_200000.weights
?
I did not read the article very carefully, maybe I missed some points and improvements. I will read it later.
Also you can try to train this cfg-file with pre-trained weights-file yolov2.conv.23
:
yolov2_xnor_fpga_new.cfg.txt
./darknet detector train cfg/voc.data yolov2_xnor_fpga_new.cfg.cfg yolov2.conv.23
@AlexeyAB, Hi,
Sorry for delay in getting back. The network you attached above have conv layers in first few layers. What I am looking is ConvX or ConvXB in all layers except first and last. So it will not be suitable for my problem.
Lets get back to my training progress. After training darknet19-xnor for two weeks (accuracy was 67%), I attached region layer and built the following network. Now training with voc dataset below is the training curve with mAP values. mAP improved as compared to tiny-yolov2-xnor network (25%), but still not that good!
I will update progress.
In addition, as I am trying to implement this paper [A Lightweight YOLOv2: A Binarized CNN with A Parallel Support Vector Regression for an FPGA], I am struggling to prepare proper target values for SVR training. If we replace region layer with svr to predict 125 outputs in each cell, do you have any idea how we have to prepare training outputs (tx,ty,tw,th,conf,prob(20)) for SVRs training. Any suggestion will be greatly appreciated. Thank you.
@ghimiredhikura Hi,
Lets get back to my training progress. After training darknet19-xnor for two weeks (accuracy was 67%), I attached region layer and built the following network. Now training with voc dataset below is the training curve with mAP values. mAP improved as compared to tiny-yolov2-xnor network (25%), but still not that good!
darknet19-xnor.cfg
on ImageNet dataset? darknet19-xnor.cfg
to darknet19-xnor.txt
and attach to your message?I am struggling to prepare proper target values for SVR training. If we replace region layer with svr to predict 125 outputs in each cell, do you have any idea how we have to prepare training outputs (tx,ty,tw,th,conf,prob(20)) for SVRs training.
I will think how to do it in the best way.
@AlexeyAB Hi,
Here is darknet19-xnor cfg file that I used. darknet19-XNOR.cfg.txt
I used ILSVRC2012 dataset for training.
Yes, please let me know how it will be the best way to replace REGION layer with SVR.
Best, Deepak
@AlexeyAB Hello,
Have you given any thoughts on how to replace region layer with SVR to predict box position and object class using linear SVRs? Any suggestions will be greatly appreciated.
Thanks.
@clydebailey @AlexeyAB https://github.com/AlexeyAB/yolo2_light/blob/master/bin/tiny-yolo-obj_xnor.cfg I used this config file to train two class model. dataset : 1000 images for each class XNOR model : 3% mAP BW : 24% FP: 27%
results after 2k iterations. all models are 61MB. How to reduce the weights file size of each model?
@ghimiredhikura
If I understand correctly, they try to use network like this: yolov2_xnor_fpga.cfg.txt - try to train this model.
This is hybrid of yolov2.cfg and yolov2-tiny.cfg. With only 1st and two last float layers, other XNOR layers.
Also check that you uncommented
difficult
in thevoc.data
file before doing./darknet detector map
...:classes= 20 train = data/train_voc.txt valid = data/2007_test.txt difficult = data/difficult_2007_test.txt names = data/voc.names backup = backup/
Hey, @AlexeyAB Do you know any yolo xnor-net implementation in a FPGA? With open-source software
Thanks!
@AlexeyAB I have successfully trained the XNOR network for yolov2-tiny and reduced the weight file by more than 10x. The mAP is amazing too with a precision of 69.54 on a single class(person) from the pascal dataset. Thanks again!
Now I would like to train a network with only weight binarizations and no input binarizations, a BWN basically. How would I go about training that? Any help?