PConv-Keras
PConv-Keras copied to clipboard
ZeroDivisionError: integer division or modulo by zero
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.


I have the same problem. Have you found a solution or is this problem still unsolved?
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).
@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".