Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
junyizhao04 opened this issue May 19, 2023 · 6 comments
Open

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

junyizhao04 opened this issue May 19, 2023 · 6 comments

Comments

@junyizhao04
Copy link

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.02
  • TensorFlow version and how it was installed (source or binary): 2.6.5
  • TensorFlow-Addons version and how it was installed (source or binary): yes, by condo
  • Python version: 3.7
  • Is GPU used? (yes/no): yes

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
Copy link
Member

andbue commented May 19, 2023

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

@junyizhao04
Copy link
Author

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
Copy link
Member

andbue commented May 21, 2023

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

@junyizhao04
Copy link
Author

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
Copy link
Member

andbue commented May 22, 2023

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).

@bertsky
Copy link
Collaborator

bertsky commented Oct 2, 2024

It's at predictor.model now, indeed. For multi-model voters, it's only available via predictor._keras_model, which is an ad-hoc class JoinedModel, but that seems to inherit from keras.Model.

Can we close @junyizhao04?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants