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

disable tensorflow/keras print-to-stdout with tf_disable_interactive_… #90

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

kba
Copy link
Member

@kba kba commented Sep 11, 2023

…logs, OCR-D/core#1091

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2023

Codecov Report

Merging #90 (2ea9780) into master (ed7a926) will decrease coverage by 80.68%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master     #90       +/-   ##
==========================================
- Coverage   85.38%   4.70%   -80.68%     
==========================================
  Files           3       3               
  Lines         171     170        -1     
  Branches       39      39               
==========================================
- Hits          146       8      -138     
- Misses         15     162      +147     
+ Partials       10       0       -10     
Files Coverage Δ
ocrd_calamari/config.py 0.00% <ø> (-100.00%) ⬇️
ocrd_calamari/recognize.py 3.63% <33.33%> (-81.22%) ⬇️

@mikegerber
Copy link
Collaborator

(The code coverage result is weird)

@mikegerber
Copy link
Collaborator

https://app.circleci.com/pipelines/github/OCR-D/ocrd_calamari/230/workflows/389c3843-ec1a-49fe-a252-4450458f9288/jobs/364

Broken for Python 3.6:

E   ImportError: cannot import name 'tf_disable_interactive_logs'

Python 3.6 is EOL since 2021-12-23, so it's time to say goodbye 😢

mikegerber added a commit that referenced this pull request Oct 12, 2023
@MehmedGIT
Copy link

Python 3.6 is EOL since 2021-12-23, so it's time to say goodbye

That version was dropped in core as well.

kba and others added 2 commits October 12, 2023 20:49
config.py's TF_CPP_MIN_LOG_LEVEL was removed but recognize.py not
adapted accordingly. Fix this by removing the use of the variable
there as well.
@mikegerber
Copy link
Collaborator

I removed testing on Python 3.6 in master and rebased this PR. This fixed it! 🚀

Copy link
Collaborator

@mikegerber mikegerber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

@mikegerber
Copy link
Collaborator

Manual test also works now.

There's some weird Nones in the output now; I'm not sure they were there before. I've opened #93 to investigate, but I'll merge this PR now.

@mikegerber mikegerber merged commit c0a4dfd into master Oct 12, 2023
1 check passed
@mikegerber mikegerber deleted the tf_disable_interactive_logs branch October 12, 2023 18:57
@mikegerber
Copy link
Collaborator

mikegerber commented Oct 17, 2023

This required ocrd >= 2.54 (for tf_disable_interactive_logs) and thus broke Python 3.6 (not that is to be supported anymore but it happened because the last ocrd version seems to 2.48 for Py 3.6). I updated the requirement in f5b4187.

@mikegerber mikegerber self-assigned this Oct 18, 2023
@mikegerber
Copy link
Collaborator

@MehmedGIT How would I (easily) test if this problem comes up again? Run the network/processing server?

I'm doing some code janitor work for #92 and this also involves some sorting of the import blocks. I disabled sorting for the block that disables interactive logs + imports TF + Calamari but I'd like to make sure.

@MehmedGIT
Copy link

@mikegerber
Copy link
Collaborator

@mikegerber, check here: https://pad.gwdg.de/Ty6IXzhIRa6AvDdC4kTy_g

Thanks. I will test another time - that's a bit more work than I had anticipated. A normal CLI call does not spew out any TF/Keras output, so I'm somewhat confident that's also OK within the processing server.

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

Successfully merging this pull request may close these issues.

4 participants