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

Error while training for more than two classes #555

Open shashi29 opened 6 years ago

shashi29 commented 6 years ago

I am getting this errot when i am traing this model for more than 1 class .

cfg/tiny-yolo-voc-1c.cfg parsing /home/bots/shashi/darkflow-master/annotations Parsing for ['Bar', 'Qr']

Statistics: Dataset size: 0 Dataset of 0 instance(s) Traceback (most recent call last): File "flow", line 6, in cliHandler(sys.argv) File "/home/bots/shashi/darkflow-master/darkflow/cli.py", line 33, in cliHandler print('Enter training ...'); tfnet.train() File "/home/bots/shashi/darkflow-master/darkflow/net/flow.py", line 39, in train for i, (x_batch, datum) in enumerate(batches): File "/home/bots/shashi/darkflow-master/darkflow/net/yolo/data.py", line 102, in shuffle batch_per_epoch = int(size / batch) ZeroDivisionError: division by zero

pbabbicola commented 6 years ago

You have a dataset of size 0. Either there are no image/annotation pairs in the folders provided or you are not providing a dataset.

EKELE-NNOROM commented 6 years ago

Hi shashi29, I assume you are using a debian based os and if think its Ubuntu. I had the same error. I turns out that ubuntu saves your xml annotations as plain text by default as such the network recognize your annotation files. In order to solve this, simply convert all your annotations which are currently in plain text to xml files. I worked like a charm for me. plaintext_to_xml.txt