LPRNet model evaluation(tools/eval.py) ZeroDivisionError: float division by zero
See original GitHub issueHi, 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
. Usetf.data.Dataset.from_tensor_slices(string_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)
. Ifshuffle=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 bytf.data
. Usetf.data.Dataset.from_tensor_slices(input_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs)
. Ifshuffle=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 bytf.data
. Usetf.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 thetf.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 thetf.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 bytf.data
. Usetf.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 bytf.data
. Usetf.data.Dataset.batch(batch_size)
(orpadded_batch(...)
ifdynamic_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 atf.sparse.SparseTensor
and usetf.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: Usetf.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 thetf.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:
- Created 4 years ago
- Comments:19 (7 by maintainers)
Top GitHub Comments
It’s now publicly available in the “Open Model Zoo”: https://github.com/opencv/open_model_zoo/tree/master/demos/security_barrier_camera_demo
@olegshentz1 You have too old version on Raspberry Pi,
22443
build is2019 R1
. Update OpenVINO to 2019R3 (latest), it should fix this problem.