-
Notifications
You must be signed in to change notification settings - Fork 41
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
Update dependencies v0.53 #499
Conversation
Codecov Report
@@ Coverage Diff @@
## master #499 +/- ##
==========================================
+ Coverage 99.48% 99.50% +0.01%
==========================================
Files 78 78
Lines 5669 5672 +3
==========================================
+ Hits 5640 5644 +4
+ Misses 29 28 -1
Continue to review full report at Codecov.
|
That's a bit of a waste, because Annif isn't really using the gensim.similarities.levenshtein module. I guess another option would be to filter the warning. I wonder why Gensim decided to do it like this.
That might speed up installing those packages with wheels available. Other than that, it shouldn't make a difference.
I'm guessing this could be related to the Lambda layer used in nn_ensemble. This warning is shown when custom layers are serialized. It's a little bit unfortunate. There is this note in the documentation for Lambda layers that explains why serialization of Lambda layers is fragile and it would perhaps be better to use a custom subclass.
This could be another symptom of serialization/deserialization issues with Lambda layers. Keras seems to use the marshal module for serializing functions; it is not compatible across Python versions. The Docker image just switched from 3.7 to 3.8 so perhaps that could have triggered this (and not the TF update in this PR)? |
I see now that Gensim has recently removed the dependency on the Levenshtein library altogether in this PR, but this change is not yet included in a release. I suggest that we avoid introducing an additional, useless dependency and instead filter the warning by importing like this (in the tfidf backend and possibly elsewhere): import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore')
import gensim.similarities |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Updated PR description for filtering Gensim warnings. |
I found some more information about the CustomMaskWarning error. It appears to be a bug in TensorFlow 2.5.0 and it's related to the Add layer, not the Lambda layer that I first suspected. I've created a draft PR #500 that replaces the Lambda layer with a custom MeanLayer. But it doesn't actually solve the CustomMaskWarning error. It might improve compatibility of saved nn_ensemble models and potentially fix the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good enough; we can't get rid of the CustomMaskWarning unless we downgrade TensorFlow, but that would also lose support for Python 3.9.
Dependency updates for Annif v0.53.
All pinned packages are updated to newest available, with two exceptions due to compatibility issues:
A notably update is upgrading joblib to 1.0.1 from 0.17.0, maybe that helps the Annif models to remain compatible for longer in future.
Also installs optional python-Levenshtein package to get rid of warnings about missing it.Filters warnings about not-installed python-Levenshtein package emitted by Gensim 4.0.1.
During installation there are messages like
Using legacy 'setup.py install' for <somepkg>, since package 'wheel' is not installed.
I suppose by installing the wheel package the messages would go away, but I wonder if it would do anything else good.There are some negligible warnings (about PyYAML version during installation and many DeprecationWarnings from tests), but one from TensorFlow could be more serious:
For now I could not find out what exactly that is about, but it could be related to the error seen when trying to use old models in Portainer (for ai.dev.finto.fi); the container fails to start due to:
However at kj-kk when I eval the old yso-fi model I see the usual UserWarnings from sklearn, and models seem to work.