https://github.com/philipperemy/tf-easy-model-saving
An easy way to load and save checkpoints in Tensorflow!
https://github.com/philipperemy/tf-easy-model-saving
tensorflow tensorflow-library tensorflow-models
Last synced: over 1 year ago
JSON representation
An easy way to load and save checkpoints in Tensorflow!
- Host: GitHub
- URL: https://github.com/philipperemy/tf-easy-model-saving
- Owner: philipperemy
- License: apache-2.0
- Created: 2017-11-25T02:09:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T07:45:35.000Z (over 7 years ago)
- Last Synced: 2025-03-19T09:40:40.047Z (over 1 year ago)
- Topics: tensorflow, tensorflow-library, tensorflow-models
- Language: Python
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tensorflow Easy Model Saving
An easy way to load and save checkpoints in Tensorflow!
## Installation
```bash
git clone https://github.com/philipperemy/tf-easy-model-saving.git
cd tf-easy-model-saving
pip3 install .
```
## Usage
Check `example.py` for more information.
### Restore model variables (<-)
```python
from easy_model_saving import model_saver
# define graph and session
last_step = model_saver.restore_graph_variables(checkpoint_dir)
if last_step == 0:
print('Did not find any weights.')
model_saver.initialize_graph_variables()
else:
print('Restore successful.')
```
### Save model variables (->)
```python
from easy_model_saving import model_saver
# define graph and session
saver = model_saver.Saver(checkpoint_dir)
saver.save(global_step=1) # global step is your epoch/gradient step.
```