-
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 for v1.2 release #796
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #796 +/- ##
========================================
Coverage 99.65% 99.65%
========================================
Files 93 93
Lines 6889 7058 +169
========================================
+ Hits 6865 7034 +169
Misses 24 24 ☔ View full report in Codecov by Sentry. |
70f7e8b
to
66512f5
Compare
Rebased and force-pushed to tidy commit history and drop upgrade to scipy 1.13 for now (because not supporting Python 3.9, which it should support?). Reminder to self: Scipy 1.13 needs these changes. |
I built Dockerimage from this branch and tried to deploy to OpenShift for the ai.dev.finto.fi instance. NN ensemble models fail to load:
|
This seems like a problem with Keras modules that have been reorganized, so older imports (from inside the saved model) no longer work. Here were two suggestions from GPT-4 on how that might be fixed: Use Custom Object ScopesIf you cannot change the TensorFlow version due to other dependencies, try using custom object scopes to map the missing or changed classes and functions: from tensorflow.keras.models import load_model
from tensorflow.keras.layers import InputLayer, Flatten, Dropout, Dense
from tensorflow.keras import layers
# Assuming `MeanLayer` is a custom layer you have the code for
from your_custom_layers import MeanLayer
custom_objects = {
'Functional': layers.Functional, # Adjust according to the actual required class
'MeanLayer': MeanLayer
}
model = load_model('path_to_your_model.keras', custom_objects=custom_objects) Adjust the Model Loading CodeSometimes, simply adjusting the import statements or model loading code can resolve compatibility issues: from tensorflow import keras
model = keras.models.load_model('path_to_your_model.keras', compile=False) |
The second suggestion by GPT-4 did not work, and for the first I don't know what layer/class here should be:
There is a Keras issue about the incompatibility of models by versions 2.15.0 and 3: keras-team/keras#20083 The |
Quality Gate passedIssues Measures |
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.
LGTM
Updates the outdated dependencies.
Depedencies, which are not upgraded to the newest releases:
Also resolves two DeprecationWarnings by Schemathesis.