ZeroDivisionError: integer division or modulo by zero
See original GitHub issueSo I am reusing the same codes from this repo for retraining. It was all working for me for the past few days until now. I received the issue below:
Traceback (most recent call last):
File "/tensorflow/tensorflow/examples/image_retraining/retrain.py", line 1486, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "/tensorflow/tensorflow/examples/image_retraining/retrain.py", line 1252, in main
FLAGS.architecture))
File "/tensorflow/tensorflow/examples/image_retraining/retrain.py", line 549, in get_random_cached_bottlenecks
image_dir, category)
File "/tensorflow/tensorflow/examples/image_retraining/retrain.py", line 254, in get_image_path
mod_index = index % len(category_list)
ZeroDivisionError: integer division or modulo by zero
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ZeroDivisionError: integer division or modulo by zero
The Python "ZeroDivisionError: integer division or modulo by zero" occurs when we use the modulo % operator with an integer and a zero....
Read more >getting ZeroDivisionError: integer division or modulo by zero
ZeroDivisionError means that you were trying to divide or modulo, a number n with 0. in your case, z = (a/(b*d)) resulted in...
Read more >integer division or modulo by zero" error. How do I solve it?
The error is integer division or modulo by zero. Your code uses modulo by zero. What is the point of checking that? def...
Read more >ZeroDivisionError: division by zero - Yawin Tutor
The zero division error is due to either a number being divided by zero, or a number being modulo by zero. The denominator...
Read more >[Solved] ZeroDivisionError: integer division or modulo by zero
The error message is self explanatory: You are dividing (or taking the modulus of) a value by zero. If the error reports a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @tushuhei, that worked perfectly! 😃
Hi nidhishgandhi,
From seeing the error saying “Label yawning has no images in the category training”, I assume it’s caused by a lack of images for training. Could you check if there are multiple images under
data/images/yawning
directory? Please refer to https://github.com/google/emoji-scavenger-hunt#build-your-own-model for more details about data setup.