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

ZeroDivisionError: integer division or modulo by zero #34

Open
SunnyPann opened this issue May 13, 2019 · 3 comments
Open

ZeroDivisionError: integer division or modulo by zero #34

SunnyPann opened this issue May 13, 2019 · 3 comments

Comments

@SunnyPann
Copy link

Thank you for sharing.I try to train on my own training set, but every epoc will report an error, I don't know what the problem is, I hope to get your help.
image

image

@StevenCyb
Copy link

I have the same problem. Have you found a solution or is this problem still unsolved?

@ghost
Copy link

ghost commented Jun 17, 2019

Solution.

'ZeroDivisionError' caused by the wrong path shows "Found 0 images belonging to 1 classes. If you do on your own dataset or imagenet dataset, make sure pick out data in the directory.
For example code, check notebooks/Step4/ "#Pick out an example codeline" with next(train / val / test_generator).

@liminn
Copy link

liminn commented Jul 9, 2019

@Parkjh215 is right.
Beacuse your validation generator get 0 images.
Change the code in main.py:

    # Create validation generator
    val_datagen = AugmentingDataGenerator(rescale=1./255)
    val_generator = val_datagen.flow_from_directory(
        args.validation, 
        MaskGenerator(512, 512, 3), 
        target_size=(512, 512), 
        batch_size=args.batch_size, 
        #classes=['val'],   # problem is here!
        seed=42
    )

Or you can remain the code unchanged, and change the directory name of your validation images to "val".

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