thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

Empty JSON file for training data #1153

Open vedrocks15 opened 4 years ago

vedrocks15 commented 4 years ago

After seeing the performance of YOLOv2 Darkflow implementation I planned to train it for th Imagenet Localization Challenge on Kaggle.

I followed all the steps in ReadMe file of the Darkflow directory.

I used 4 classes in label.txt (I pass it as an argument) -> n01494475 , n01531178 ,n01530575 ,n01518878 (the names that I specified in the label.txt file because these are the names in the annotations file which is in xml).

I placed all the images in a training/image directory therefore I have 12 images in total i.e. 3 images in each of the 4 classes. Their respective annotations are in the training/annotation directory.

I copied a yolo.cfg file as Yolo-new.cfg and modified the number of classes and filters according to the formula. I have almost trained for (1200 steps)

I wanted to train it from scratch so I used the following command : python3 flow --model cfg/yolo-new.cfg --load -1 --train --trainer adam --dataset Training/image/ --annotation /Training/annotations/ --labels label.txt --lr 0.00004 --epoch 500 and the error came down to 0.7.

To test I passed python3 flow --model cfg/yolo-new.cfg --load -1 --imgdir Training/image/ --json --labels label.txt but in the out subdirectories I get no predictions (at least for training data I should get some predictions or should I try to bring the error to 0.1 ? ). What am I doing wrong here ?