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

Better save + load #114

Merged
merged 2 commits into from
Nov 19, 2020
Merged

Better save + load #114

merged 2 commits into from
Nov 19, 2020

Conversation

cgarciae
Copy link
Collaborator

@cgarciae cgarciae commented Nov 19, 2020

Reinserts saving the model separate from the weights to improve portability. If elegy.model.load gives you an error due to the model.pkl you can still try to construct the model yourself using its source code and then use Model.load to load its weights which are saved as .h5.

Caveats:

  • The optimizer state is still saved as a separate file using pickle due to deepdish handing of NamedTuples as regular tuples. If you get an error when loading the optimizer you can set include_optimizer=False on the load functions.

@cgarciae cgarciae changed the title feature/better-save-load Better save + load Nov 19, 2020
@codecov-io
Copy link

codecov-io commented Nov 19, 2020

Codecov Report

Merging #114 (c9eaab6) into master (b5011fc) will decrease coverage by 0.29%.
The diff coverage is 9.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #114      +/-   ##
==========================================
- Coverage   77.24%   76.94%   -0.30%     
==========================================
  Files         102      102              
  Lines        4728     4746      +18     
==========================================
  Hits         3652     3652              
- Misses       1076     1094      +18     
Impacted Files Coverage Δ
elegy/model/model.py 72.04% <9.09%> (-9.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5011fc...c9eaab6. Read the comment docs.

@cgarciae cgarciae merged commit 3494cc7 into master Nov 19, 2020
@cgarciae cgarciae deleted the feature/better-save-load branch November 19, 2020 16:37
alexander-g pushed a commit to alexander-g/elegy that referenced this pull request Nov 21, 2020
cgarciae added a commit that referenced this pull request Dec 3, 2020
* imagenet example now can be run with flags

* README.md for imagenet

* removed unnecessary Lambda class from mnist.py

* global average pooling should come before linear

* format

* Better save + load (#114)

Co-authored-by: Cristian Garcia <cgarcia.e88@gmail.com>
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.

None yet

2 participants