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)
])
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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a93971af2c2013cec96e8cea62e29f4299247b7f044339099a34f5935ff59284 |
|
MD5 | f87dcecccb3b0a09c66aff3d0177e438 |
|
BLAKE2b-256 | d6e2b323a75682a421428d6b3e90b92fa8a0c47ddd973e4659010986d2c77549 |
Close
Hashes for alt_model_checkpoint-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6721d13d781f621d8ac35bba5d239b6e8656a20b4e81cc7a7f5c2614e036d817 |
|
MD5 | f66db701940a8e1c0dcde4287a7a8ca7 |
|
BLAKE2b-256 | 5460a5f189e2ea89ae1709c2d2212d18bbfed4eaffe8c26088fc90376711934f |