An open API service indexing awesome lists of open source software.

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!

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.
```