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
You must provide your own Keras or Tensorflow installation. See Pipfile
for preferred versions.
If using the Keras bundled in Tensorflow:
from alt_model_checkpoint.tensorflow import AltModelCheckpoint
If using Keras standalone:
from alt_model_checkpoint.keras import AltModelCheckpoint
Common usage involving multi-GPU models built with Keras multi_gpu_model()
:
from alt_model_checkpoint.keras 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 test
(runsmake test-build
automatically to ensure deps)
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.13.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e01f9c3c7b1661359b30549ba110c25ba16fa9d27e95c6371f4d90b3a418097 |
|
MD5 | f5e6572fc595869db0ea68e766c067d8 |
|
BLAKE2b-256 | 22cd50af5d46294185a31c097b16a2f3e4e2e2d0b9b5a35ce421edbc44d189bf |
Close
Hashes for alt_model_checkpoint-1.13.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 076619e5986b92d950d1cff864137afa3fa74084822af94e23e520ac8ceeeed9 |
|
MD5 | 3ff005ee79b79b95c2a689bea74537a9 |
|
BLAKE2b-256 | 2bf139f9c171a5da62b4d55898f487638bb2de02b9ee7332ddd618a6c109675d |