Skip to main content

Deep learning Keras models lifecycle management backup/restore nano framework

Project description

DL backup/restore nano framework

Makes it easy to start/stop/resume deep learning models training.

Current version supports only for Keras >= 2.2 models. You're welcome to contribute.

Usage

pip3 install sizif

Local filesystem Keras checkpoints backup:

from sizif.keras import KerasModelWrapper
from sizif.storage import FileCheckpointsMonitor

# your compiled Keras Model instance
model = build_model()  


# Snapshots monitor
# Different model architectures should have different version parameter
# other parameters similar to Keras ModelCheckpoint
cpm = FileCheckpointsMonitor(version=1,
                            file_template='weights.{epoch:03d}-vl{val_loss:.3f}.hdf5',
                            folder='./checkpoints',
                            rotate_number=5,
                            monitor='val_acc',
                            verbose=1,
                            save_best_only=False,
                            save_weights_only=True,
                            mode='auto',
                            period=1)

# Keras wrapper, proxies all calls to the model
# except fit and fit_generator — which are surrounded 
# by automated model state backup/recovery   
km = KerasModelWrapper(model, cpm)

# all method parameters ar proxied to Keras as is except callbacks
km.fit_generator(training_set_generator,
                 epochs=25,
                 validation_data=test_set_generator,
                 callbacks=[tboard])

See sources for detailed docstrings

TODO:

  • FTP/S3/SFTP/Dropbox uploading monitors
  • Tensorflow/Pytorch models support

Tests

python3 -m unittest 

Dependencies

  • numpy ~> 1.15
  • Keras ~> 2.2

License

This project is released under the MIT license.

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

sizif-0.0.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sizif-0.0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file sizif-0.0.1.tar.gz.

File metadata

  • Download URL: sizif-0.0.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for sizif-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1835999d7fb42cad2e68ed4a7e16754d407b0ef2d1022161d1465690b357df48
MD5 8cb767805540cb68563ac1382f4cb234
BLAKE2b-256 7a4a4eee9bbb64a8f0b921b1821b8176832ce524ff1478d97ffb6c4971d5530c

See more details on using hashes here.

File details

Details for the file sizif-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sizif-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for sizif-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2da16e32f3347f3c4a9b13141b40aebbb2de3ff22f7ecb23e120d00a1de2cbdb
MD5 cfcae5e7237d5b2c9658ffcd46b787c8
BLAKE2b-256 538fa6b03d99dc8c41ea1ea6723d80ab0f744eb381e109ea65021f225b3e26ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page