Skip to main content

DL backup/restore nano framework

Auto backup/restore model snapshots of deep learning models:

  • to/from local filesystem
  • to/from remote FTP server

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

Usage

pip3 install sizif

FTP Keras checkpoints backup/restore:

from sizif.keras import KerasModelWrapper
from sizif.storage import FTPFileCheckpointsMonitor

# your compiled Keras Model instance
model = build_model()  


# Local filesystem snapshots monitor with FTP backup/restore 
# Different model architectures should have different version parameter
# other parameters similar to Keras ModelCheckpoint
# See sizif.storage.FileCheckpointsMonitor for local file only backup/restore 
cpm = FTPFileCheckpointsMonitor(1,
                               'weights.{epoch:03d}-vl{val_loss:.3f}-va{val_acc:.3f}.hdf5',
                               local_folder='/snapshots_local_dir',
                               remote_folder='/snapshots_ftp_dir',
                               host='ftp.your-host.com', login='your_ftp_login',
                               password='your_ftp_password',
                               die_on_ftperrors=True,
                               rotate_number=3,
                               monitor='val_loss',
                               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 are proxied to Keras as is except callbacks
# callbacks are extended with `cpm` listener 
km.fit_generator(training_set_generator,
                 epochs=25,
                 validation_data=test_set_generator,
                 callbacks=[tboard])

See sources for detailed docstrings

TODO:

  • SSH/S3/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.

Metadata

Release files for sizif 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sizif 0.0.7
File Size Uploaded Provenance Actions
sizif-0.0.7.tar.gz 11.1 kB Without provenance Details for sizif-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sizif 0.0.7
File Interpreter ABI Platform Actions
sizif-0.0.7-py3-none-any.whl Python 3 none any Details for sizif-0.0.7-py3-none-any.whl

Total release size: 24.3 kB

Release files / sizif-0.0.7.tar.gz

Download URL sizif-0.0.7.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d9b3e9da82535844c87f640091588ebf97af238738f78fc034935efded029101
BLAKE2b-256 checksum
How to use checksums
f75f4aa4954f73d9b8ca3bcc02f9807e93f254b2147535d3acbb22fa0d0c39cc
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / sizif-0.0.7-py3-none-any.whl

Download URL sizif-0.0.7-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0817626277f61d9ffc035b07a353c65cdbd47c5e07a783be2bd9415be0ad0306
BLAKE2b-256 checksum
How to use checksums
b3775a9e29e41a5135c33bc90b8229f96a8ea6bd4c54fffbf520674be194fc76
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for sizif 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page