Calamari-OCR / calamari

Line based ATR Engine based on OCRopy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calamari-predict: Exception, when prediction is 0%

stefanCCS opened this issue · comments

Version 2.1.5
It looks like that calamari-predictraises an exception, when a prediction value of 0% is recognized:

Prediction:   0%|                                                                                                                                                                    | 0/13 [00:00<?, ?it/s]2022-02-24 13:18:22.349295: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
2022-02-24 13:18:22.349663: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 2394370000 Hz
WARNING  2022-02-24 13:18:24,319 tfaip.util.multiprocessing.dat: Invalid data. Skipping for the 1. time.
Prediction:   0%|                                                                                                                                                                    | 0/13 [00:02<?, ?it/s]
CRITICAL 2022-02-24 13:18:24,660             tfaip.util.logging: Uncaught exception
Traceback (most recent call last):
  File "/home/calamariadmin/calamari_venv_37/bin/calamari-predict", line 8, in <module>
    sys.exit(main())
  File "/home/calamariadmin/calamari_venv_37/lib/python3.7/site-packages/calamari_ocr/scripts/predict.py", line 188, in main
    run(args.root)
  File "/home/calamariadmin/calamari_venv_37/lib/python3.7/site-packages/calamari_ocr/scripts/predict.py", line 175, in run
    logger.info("Average sentence confidence: {:.2%}".format(avg_sentence_confidence / n_predictions))
ZeroDivisionError: division by zero

==> Please check ...

Fixed in v2.2.1 via 8e2e6b8

@andbue : When do you plan to publish v2.2.1 via "pip"?

Already there since yesterday evening: https://pypi.org/project/calamari-ocr/2.2.1/