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

Switch to Keras v3 save format for nn_ensemble #730

Merged
merged 13 commits into from
Aug 16, 2023

Conversation

osma
Copy link
Member

@osma osma commented Aug 16, 2023

With the TensorFlow 2.13 update in PR #726, these warnings are shown:

UserWarning: You are saving your model as an HDF5 file via `model.save()`. This file format is considered legacy. We recommend using instead the native Keras format, e.g. `model.save('my_model.keras')

This PR addresses the problem by switching to the new Keras v3 (.keras) format for saving the trained nn_ensemble models.

Keras imports are modernized so that they follow current conventions (no need to use tensorflow.keras, and switched to the new keras.saving submodule).

Note that this PR branch includes all the commits from PR #726.

@osma osma added this to the 1.0 milestone Aug 16, 2023
@osma osma self-assigned this Aug 16, 2023
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (40cc2fd) 99.67% compared to head (4886e08) 99.67%.
Report is 4 commits behind head on main.

❗ Current head 4886e08 differs from pull request most recent head 1c8bc48. Consider uploading reports for the commit 1c8bc48 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #730   +/-   ##
=======================================
  Coverage   99.67%   99.67%           
=======================================
  Files          89       89           
  Lines        6397     6420   +23     
=======================================
+ Hits         6376     6399   +23     
  Misses         21       21           
Files Changed Coverage Δ
annif/backend/ensemble.py 100.00% <ø> (ø)
annif/backend/nn_ensemble.py 100.00% <100.00%> (ø)
annif/backend/svc.py 100.00% <100.00%> (ø)
tests/test_backend_nn_ensemble.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@osma osma force-pushed the update-dependencies-v1.0-keras-save-format branch from 4886e08 to 1c8bc48 Compare August 16, 2023 08:48
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma requested a review from juhoinkinen August 16, 2023 08:53
Copy link
Member

@juhoinkinen juhoinkinen left a comment

Choose a reason for hiding this comment

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

LGTM

@osma osma mentioned this pull request Aug 16, 2023
@osma osma merged commit 88a19bf into main Aug 16, 2023
@osma osma deleted the update-dependencies-v1.0-keras-save-format branch August 16, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants