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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24d7f699226f4b06ce1c28988ea12c9333f69a39fdc726eb300acff36dc26692 |
|
MD5 | 456745fe37a3fda82b8c6e783bee6537 |
|
BLAKE2b-256 | 565504433cd526f5f175169dc689395edac5e5f4783d9674927d4500e25c02c2 |
Close
Hashes for alt_model_checkpoint-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e770ded1c1008671dc39b83db8dab907767a32f59dd3b4b1d8930d50cb2fceb |
|
MD5 | 670688af43effdfd923b029699570264 |
|
BLAKE2b-256 | c733b69ebe9ef2ac714f615a3d05aba3cb0af4a91ee67986a2ff2d186d06f678 |