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
run image_retraining always get ‘integer division or modulo by zero’ #2072
Comments
You probably saw this warning when running: The retrain script randomly assigns images into three sets: 'training', 'testing', and 'validation' in a way that means you may have 0 validation files if you have less than 20 total training images for a particular label. Try adding at least 20 images per label and you should be good. Here is the comment in tensorflow/tensorflow/examples/image_retraining/retrain.py that explains what is happening: |
thanks for ur answer,I just fixed it by set a constant value when it get zero.and I got the final pb file and test will. |
After step 0 of finding train accuracy and cross entropy , i am getting error: I have two class folders : darth vader = 60 images of darth vader and darth maul =60 images. |
I had the same issue, I resolved it by increasing the number of images. |
Thanks , I will check this out On 8 November 2016 at 06:40, Pawel Ratajczak notifications@github.com
|
so i have about 30 in each folder (not the same number in each). all category look similar. works fine. add to more categorys and i end up here... i fear overriding this if i can photos are hard to find for me... |
Why not ensuring that there is at least an image in validation? At least it does not crash.
|
it worked.. i increased image sizes above 25.. |
For those who have more than 50 images per class and still get the error: The code only works with .jpg files, you need to add 'png' to the list of extensions in 'retrain.py'. |
I tried
bazel build tensorflow/examples/image_retraining:retrain && \ bazel-bin/tensorflow/examples/image_retraining/retrain \ --image_dir ~/flowers
but get
retrain.py", line 257, in get_image_path mod_index = index % len(category_list) ZeroDivisionError: integer division or modulo by zero
I have got some files, like flower.jpg.txt.
why the length of category list could be zero?
The text was updated successfully, but these errors were encountered: