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: division by zero' #60

Open
KouateMuhamed opened this issue Dec 24, 2020 · 2 comments
Open

'ZeroDivisionError: division by zero' #60

KouateMuhamed opened this issue Dec 24, 2020 · 2 comments

Comments

@KouateMuhamed
Copy link

Hi,
I downloaded the MVTec dataset and am trying to launch the training using carpet images.
However, when I try to run the train.py script python3 train.py -d mvtec/carpet/ -a mvtecCAE -b 2 -l ssim -c grayscale, it returns me the reported error:

Found 0 images belonging to 2 classes. Found 0 images belonging to 2 classes. INFO:autoencoder.autoencoder:initiating learning rate finder to determine best learning rate. simulating training for different learning rates... this may take a few moments... Traceback (most recent call last): File "train.py", line 238, in <module> main(args) File "train.py", line 81, in main autoencoder.find_lr_opt(train_generator, validation_generator) File "/home/thomas/MVTec-Anomaly-Detection/autoencoder/autoencoder.py", line 191, in find_lr_opt restore_weights_only=True, File "/root/anaconda3/envs/mvtec/lib/python3.6/site-packages/ktrain/core.py", line 553, in lr_find verbose=verbose) File "/root/anaconda3/envs/mvtec/lib/python3.6/site-packages/ktrain/lroptimize/lrfinder.py", line 94, in find self.lr_mult = (end_lr / start_lr) ** (1 / num_batches) ZeroDivisionError: division by zero

How can I fix it?

@init-22
Copy link

init-22 commented Apr 19, 2021

same error, did you find the solution?

@JesusRH97
Copy link

Hey guys. I faced the same issue and I just came up with the solution. The only thing you gotta do is following the instructions from the readme file regarding to the project structure. This 'ZeroDivisionError: division by zero' error happens because the script is not finding any train/ folder inside your mvtec/carpet/ path. Create a folder inside carpet/ and call it "train". Just that. The script will automatically load the images from the train/ folder.

I hope it helps.

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