question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LPRNet model evaluation(tools/eval.py) ZeroDivisionError: float division by zero

See original GitHub issue

Hi, thanks for this great rep

I’m following LPRNet: License Plate Recognition(CPU) guide. I’ve prepared dataset based on 8k numeric only vehicle plates. Currently I’ve reached 209000 / 250000 iteration, but when using python3 tools/eval.py chinese_lp/config.py to start evaluation process got ZeroDivisionError.

Stacktrace:

Traceback (most recent call last): File “tools/eval.py”, line 174, in <module> tf.app.run(main) File “/home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py”, line 125, in run _sys.exit(main(argv)) File “tools/eval.py”, line 170, in main validate(cfg) File “tools/eval.py”, line 140, in validate tf.Summary(value=[tf.Summary.Value(tag=‘evaluation/acc’, simple_value=float(mean_accuracy / num)), ZeroDivisionError: float division by zero

The terminal output:

WARNING:tensorflow:From tools/eval.py:53: string_input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version. Instructions for updating: Queue-based input pipelines have been replaced by tf.data. Use tf.data.Dataset.from_tensor_slices(string_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs). If shuffle=False, omit the .shuffle(...). WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/training/input.py:278: input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version. Instructions for updating: Queue-based input pipelines have been replaced by tf.data. Use tf.data.Dataset.from_tensor_slices(input_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs). If shuffle=False, omit the .shuffle(...). WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/training/input.py:190: limit_epochs (from tensorflow.python.training.input) is deprecated and will be removed in a future version. Instructions for updating: Queue-based input pipelines have been replaced by tf.data. Use tf.data.Dataset.from_tensors(tensor).repeat(num_epochs). WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/training/input.py:199: QueueRunner.init (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version. Instructions for updating: To construct input pipelines, use the tf.data module. WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/training/input.py:199: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version. Instructions for updating: To construct input pipelines, use the tf.data module. WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/training/input.py:202: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. WARNING:tensorflow:From tools/eval.py:38: TextLineReader.init (from tensorflow.python.ops.io_ops) is deprecated and will be removed in a future version. Instructions for updating: Queue-based input pipelines have been replaced by tf.data. Use tf.data.TextLineDataset. WARNING:tensorflow:From tools/eval.py:48: batch (from tensorflow.python.training.input) is deprecated and will be removed in a future version. Instructions for updating: Queue-based input pipelines have been replaced by tf.data. Use tf.data.Dataset.batch(batch_size) (or padded_batch(...) if dynamic_pad=True). WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/contrib/layers/python/layers/layers.py:1624: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version. Instructions for updating: Use keras.layers.flatten instead. WARNING:tensorflow:From tools/eval.py:84: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. WARNING:tensorflow:From tools/eval.py:87: sparse_to_dense (from tensorflow.python.ops.sparse_ops) is deprecated and will be removed in a future version. Instructions for updating: Create a tf.sparse.SparseTensor and use tf.sparse.to_dense instead. WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py:193: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02. Instructions for updating: Use tf.global_variables_initializer instead. 2019-10-27 14:09:01.524225: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-10-27 14:09:01.546937: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2712000000 Hz 2019-10-27 14:09:01.547231: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x22bed10 executing computations on platform Host. Devices: 2019-10-27 14:09:01.547248: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): <undefined>, <undefined> WARNING:tensorflow:From tools/eval.py:101: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version. Instructions for updating: To construct input pipelines, use the tf.data module. WARNING:tensorflow:tf.train.start_queue_runners() was called when no queue runners were defined. You can safely remove the call to this deprecated function. WARNING:tensorflow:From /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/training/saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. INFO:tensorflow:Restoring parameters from /home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/model/model.ckpt-209000.ckpt GT label fails: 10002898 GT label fails: 10002936 GT label fails: 1000546 GT label fails: 10002267 GT label fails: 1001394 GT label fails: 10003908 GT label fails: 10002635 GT label fails: 10000048 GT label fails: 10002384 GT label fails: 10002031 GT label fails: 10003819 GT label fails: 10001808 GT label fails: 1002304 GT label fails: 10002396 GT label fails: 1001353 GT label fails: 10000918 GT label fails: 10002725 GT label fails: 1002142 GT label fails: 10000493 GT label fails: 1003345 GT label fails: 10001589 GT label fails: 10002119 GT label fails: 1003271 GT label fails: 10002378 GT label fails: 10000417 GT label fails: 1003082 GT label fails: 10000873 GT label fails: 1000182 GT label fails: 1001581 GT label fails: 1002264 GT label fails: 1000551 GT label fails: 1000237 GT label fails: 1003602 GT label fails: 10002089 GT label fails: 1002935 GT label fails: 1002678 GT label fails: 10003173 GT label fails: 1001547 GT label fails: 1002028 GT label fails: 1003043 GT label fails: 1000977 GT label fails: 1002087 GT label fails: 10000391 GT label fails: 1003363 GT label fails: 10003695 GT label fails: 1000385 GT label fails: 10002303 GT label fails: 10003081 GT label fails: 10002244 GT label fails: 10000527 GT label fails: 1001206 GT label fails: 1001512 GT label fails: 1003981 GT label fails: 10002101 GT label fails: 10003316 GT label fails: 10003582 GT label fails: 10003934 GT label fails: 1001628 GT label fails: 1003915 GT label fails: 10002390 GT label fails: 10003749 GT label fails: 1003729 GT label fails: 1001055 GT label fails: 1003415 GT label fails: 1001338 GT label fails: 10001389 GT label fails: 10003928 GT label fails: 1003445 GT label fails: 10003967 GT label fails: 1003297 GT label fails: 1003211 GT label fails: 1001340 GT label fails: 10003567 GT label fails: 10002065 GT label fails: 1002887 GT label fails: 1002692 GT label fails: 10001737 GT label fails: 1001179 GT label fails: 10001246 GT label fails: 1000672 Traceback (most recent call last): File “tools/eval.py”, line 174, in <module> tf.app.run(main) File “/home/oleg/Documents/openvino_training_extensions/tensorflow_toolkit/lpr/venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py”, line 125, in run _sys.exit(main(argv)) File “tools/eval.py”, line 170, in main validate(cfg) File “tools/eval.py”, line 140, in validate tf.Summary(value=[tf.Summary.Value(tag=‘evaluation/acc’, simple_value=float(mean_accuracy / num)), ZeroDivisionError: float division by zero

Environment:

  • OS: Linux Ubuntu 18.04
  • Python version: 3.6.8
  • OpenVINO version: 2019 R3
  • Using CPU tensorflow model

Thanks, Oleg

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
brmarkuscommented, Oct 30, 2019

It’s now publicly available in the “Open Model Zoo”: https://github.com/opencv/open_model_zoo/tree/master/demos/security_barrier_camera_demo

1reaction
AlexanderDokuchaevcommented, Oct 29, 2019

@olegshentz1 You have too old version on Raspberry Pi, 22443 build is 2019 R1. Update OpenVINO to 2019R3 (latest), it should fix this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LPRNet model evaluation(tools/eval.py) ZeroDivisionError ...
Hi, thanks for this great rep. I'm following LPRNet: License Plate Recognition(CPU) guide. I've prepared dataset based on 8k numeric only ...
Read more >
How to fix "ZeroDivisionError: float division by zero"
The ZeroDivisionError happens when you try to divide a number by 0, which as you know is a mathematical impossibility, just change the...
Read more >
ZeroDivisionError when trying to train MaskRCNN - vision
My custom dataset and model build seem to pass, but I run into this ZeroDivisionError upon training. ... ZeroDivisionError: float division by zero....
Read more >
Stock Entry - ZeroDivisionError: float division by zero
This refers to a failed validation check. github.com · frappe/erpnext/blob/develop/erpnext/controllers/item_variant.py#L82.
Read more >
Why Python's ZeroDivisionError for floating-point type is a bad ...
The fact that Python raises a ZeroDivisionError instead of returning inf from zero division seems to be in violation of the IEEE 754...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found