-
Notifications
You must be signed in to change notification settings - Fork 31
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
warnings in processor output garble dump-json #1223
Comments
To be precise, in this case the message from TF logging causing the hickup was not a warning (as the issue suggests) but an error. All our TF-based processors now suppress log messages below that level anyway. But my point is about log messages from imported modules in general, and if we find a solution here, then these special TF rules may not even be necessary anymore. |
Duh! That by itself won't suffice, of course: when the processor wrapper gets used, TF usually is already imported and thus initialised. So perhaps we should make sure that our processors don't make imports other than OCR-D related – until required to do |
…which in the case of ocrd_calamari is tricky: it wants to |
In another example, I get garbled JSON from the following error:
|
Regarding the
|
We should implement this along with the #322 API changes – so we don't need touch the processor code bases twice.
In this case it is still possible to initialise logging before importing Tensorflow, so even that should not be a problem. As to the logging setup itself – it would not even have to be |
@kba @MehmedGIT what do you think? Should I move Only in v3, or also in v2 (since this looks similar in both versions), perhaps as part of #1288? |
We have…
So because TF spew a warning about a CPU mismatch, the
--dump-json
output is broken andocrd process
cannot validate the workflow.IMO this likely affects all processors in one form or another. When we instantiate a processor in the CLI decorator, there is no
initLogging
call for the--dump-json
target, but TF can still do its own basicConfig, which will use stdout.So perhaps we should do our own
basicConfig(handlers=[logging.NullHandler()], force=True)
, or alternatively just calllogging.disable(sys.maxsize)
in core'socrd_cli_wrap_processor
(which will be before any processor-specific imports)?The text was updated successfully, but these errors were encountered: