deep-diver / Soccer-Ball-Detection-YOLOv2

YOLOv2 trained against custom dataset
116 stars 43 forks source link

Dataset Size: 0 ZeroDivision error #9

Open prithusuresh opened 5 years ago

prithusuresh commented 5 years ago

Hey, I'm training my custom dataset of four classes and for some reason .train() throws the following error cfg/yolo_custom.cfg parsing /home/iot/darkflow/data/ann/ Parsing for ['Apple', 'Cucumber', 'Tomato', 'Carrot']

Statistics: Dataset size: 0 Dataset of 0 instance(s)

ZeroDivisionError Traceback (most recent call last)

in () ----> 1 tfnet.train() ~/darkflow/darkflow/net/flow.py in train(self) 37 loss_op = self.framework.loss 38 ---> 39 for i, (x_batch, datum) in enumerate(batches): 40 if not i: self.say(train_stats.format( 41 self.FLAGS.lr, self.FLAGS.batch, ~/darkflow/darkflow/net/yolo/data.py in shuffle(self) 100 print('Dataset of {} instance(s)'.format(size)) 101 if batch > size: self.FLAGS.batch = batch = size --> 102 batch_per_epoch = int(size / batch) 103 104 for i in range(self.FLAGS.epoch): ZeroDivisionError: division by zero I've rechecked my dataset and all the jpg files have a corresponding text file. My options dictionary looks like this options = {"model": "cfg/yolo_custom.cfg", "load": "bin/yolo.weights", "batch": 8, "epoch": 100, "gpu": 0, "train": True, "verbalize":True, "annotation":"/home/iot/darkflow/data/ann/", "dataset": "/home/iot/darkflow/data/images/"}
prithusuresh commented 5 years ago

I figured that the my annotation file format is different from yours. While my is as in .txt format yours is .xml. could it be because of this?

Ign0reLee commented 5 years ago

Hi If you made .txt format, you have to convert to .xml with same parameter

After convert, if raise same problem, you also change some DarkNet code.

See this link, https://github.com/thtrieu/darkflow/issues/879

That's why, most of people occured Zero division error

deep-diver commented 4 years ago

thanks for the big help!