Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset Size: 0 ZeroDivision error #9

Open
prithusuresh opened this issue Apr 3, 2019 · 3 comments
Open

Dataset Size: 0 ZeroDivision error #9

prithusuresh opened this issue Apr 3, 2019 · 3 comments

Comments

@prithusuresh
Copy link

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
Copy link
Author

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
Copy link
Contributor

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,
thtrieu/darkflow#879

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

@deep-diver
Copy link
Owner

thanks for the big help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants