Calamari-OCR / calamari

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

calamari/1.0: Remove noisy/useless print around model.summary() call #350

Closed mikegerber closed 1 month ago

mikegerber commented 10 months ago

In the TensorflowModel constructor, model.summary() is called to output a summary of the model created/loaded. TF's summary() prints itself, but returns None, so the print() around it always prints "None".

OCR-D just configured the amount of noi... console output wanted from TensorFlow, so while I don't get any output from summary() anymore, I do see this spurious "None", which we didn't notice before within the other messages by TF.

Only applies to Calamari 1.0, I think - but I didn't check 2.x very thoroughly.

API docs: https://www.tensorflow.org/api_docs/python/tf/keras/Model#summary

mikegerber commented 10 months ago

OCR-D just configured the amount of noi... console output wanted from TensorFlow, so while I don't get any output from summary() anymore,

Clarification: OCR-D set TensorFlow log level and I believe this causes model.summary() to be silent. That's not a problem in Calamari, this just lead me to notice the noisy print(None) (effectively).