Calamari-OCR / calamari

Line based ATR Engine based on OCRopy
Apache License 2.0
1.04k stars 209 forks source link

"No training configuration" for code that should not have one #340

Open junyizhao04 opened 1 year ago

junyizhao04 commented 1 year ago

System information

Describe the bug

I tried to fill in the spaces of the code provided in the tutorial with single model written here:

https://calamari-ocr.readthedocs.io/en/latest/doc.predicting.html

INFO 2023-05-18 23:47:16,968 calamari_ocr.ocr.savedmodel.sa: Checkpoint version 5 is up-to-date. INFO 2023-05-18 23:47:17,012 tfaip.device.device_config: Setting up device config DeviceConfigParams(gpus=None, gpu_auto_tune=False, gpu_memory=None, soft_device_placement=True, dist_strategy=<DistributionStrategy.DEFAULT: 'default'>) WARNING 2023-05-18 23:47:18,433 tensorflow: No training configuration found in the save file, so the model was not compiled. Compile it manually. WARNING 2023-05-18 23:47:18,433 tensorflow: No training configuration found in the save file, so the model was not compiled. Compile it manually.

All files used here are from calamari files on Github.

andbue commented 1 year ago

Thanks for reporting! Just to be sure: this is only about the unnecessary warning, prediction works as intended?

junyizhao04 commented 1 year ago

Thanks for reporting! Just to be sure: this is only about the unnecessary warning, prediction works as intended?

It's very weird: when you call python .py, it does not work and run into some endless loop. but when calling python then doing import , it works.

andbue commented 1 year ago

This is not related to the warning. You need a if __name__ == "__main__" block in your script, then calling it will work.

junyizhao04 commented 1 year ago

Thank you! one more question: I saw previous works on Calamari OCR used Predictor.network, but I cannot call it today. Is it retired? If so, where can I fetch the network?

andbue commented 1 year ago

I'm not entirely sure at the moment, but I guess it's now at Predictor.model (https://tfaip.readthedocs.io/en/latest/tfaip.predict.html#module-tfaip.predict.predictor).