Soccer-Ball-Detection-YOLOv2 icon indicating copy to clipboard operation
Soccer-Ball-Detection-YOLOv2 copied to clipboard

Dataset Size: 0 ZeroDivision error

Open prithusuresh opened this issue 6 years ago • 3 comments

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 avatar Apr 03 '19 04:04 prithusuresh

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?

prithusuresh avatar Apr 03 '19 04:04 prithusuresh

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

Ign0reLee avatar Jun 20 '19 05:06 Ign0reLee

thanks for the big help!

deep-diver avatar Sep 02 '19 14:09 deep-diver