An adapter callback for Keras ModelCheckpoint that allows checkpointing an alternate model (often submodel of a multi-GPU model).
Project description
alt-model-checkpoint
An adapter callback for Keras ModelCheckpoint that allows checkpointing an alternate model (often submodel of a multi-GPU model).
Installation
pip install alt-model-checkpoint
Usage
The import you need is:
from alt_model_checkpoint import AltModelCheckpoint
Common usage involving multi-GPU models built with Keras multi_gpu_model()
:
from alt_model_checkpoint import AltModelCheckpoint
from keras.models import Model
from keras.utils import multi_gpu_model
base_model = Model(...)
gpu_model = multi_gpu_model(base_model)
gpu_model.compile(...)
gpu_model.fit(..., callbacks=[
AltModelCheckpoint('save/path/for/model.hdf5', base_model)
])
Dev environment setup
- Install pipenv.
- Run
make
.
Running tests
Run make test
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for alt-model-checkpoint-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5aa2d096ef064f5b1df47354cd04c75966dbd73f54b43c619f472b0da82ba781 |
|
MD5 | e9bf0599360616afc81e78b9c2f766e5 |
|
BLAKE2b-256 | 2421336dd8cebaadb4384c7cec5bd75e0a54325a2faa5fa0e0b2c5d3e3d84696 |
Close
Hashes for alt_model_checkpoint-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52370688e63466ac7860afc2de592a7c9b8d0747ad0281f24f328276e18c78be |
|
MD5 | 674820e3a0da07f30aff4b8a66dbe208 |
|
BLAKE2b-256 | 1496eaf9186989c7350177ab7475c6e129dd46d5232863cfab132056edf2010f |