Skip to main content

Callback prepared to log checkpoints to minio server.

Project description

Pytorch Lightning Minio Callback

Callback prepared to log checkpoints and tensorboard data to minio server.

Minimum Requirements

Python 3.6 or higher.

Download using pip

pip3 install pl-minio-callback

Download source

git clone https://github.com/dpulpeiro/pl-minio-callback
cd pl-minio-callback
python setup.py install

Quick Start Example

This example shows how to use the class MinioCallback to upload checkpoints to minio server.

You can use this docker-compose to launch a minio instance with only one volume in the ports 9000 and 9001 with user 'minio' and password 'minio123'

Parameters Description
save_dir Directory to save models in.
name Sub-directory to save models in.
upload_models Whether to upload the checkpoints or not
upload_hparams Whether to upload the hparams or not
upload_tensorboard_data Whether to upload tensorboard data or not
bucket Name of the bucket where data will be stored
endpoint URL to minio service.
endpoint URL to minio service.
access_key Access key (aka user ID) of an account in the minio service.
secret_key Secret key (aka password) of an account in the minio service.
secure Whether endpoint uses https or not.
secure Whether endpoint uses https or not.

Files will be saved in disk with the following file structure

    <save_dir>/<name>/version_x/checkpoints_and_tensorboard_data

They will also be uploaded to minio:

    <bucket>/<save_dir>/<name>/version_x/checkpoints_and_tensorboard_data

Usage

...
from pl_minio_callback.minio_callback import MinioCallback

...
if __name__ == "__main__":
    ...
    logger = TensorBoardLogger(save_dir="models", name="cifar10_resnet")  # Check parameters
    trainer = pl.Trainer(
        callbacks=[
            MinioCallback(
                upload_tensorboard_data=False,
                upload_hparams=False,
                upload_checkpoints=True,
                bucket="tensorboard",
                endpoint="localhost:9000",
                access_key="minio",
                secret_key="minio123",
                secure=False
            )
        ],
        log_every_n_steps=5,
        checkpoint_callback=True,
        logger=logger,
        max_epochs=10,
        gpus=1,
        auto_select_gpus=True
    )
    ...

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

pl-minio-callback-1.0.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

pl_minio_callback-1.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pl-minio-callback-1.0.4.tar.gz.

File metadata

  • Download URL: pl-minio-callback-1.0.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.5.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.8.0 tqdm/4.61.1 CPython/3.7.3

File hashes

Hashes for pl-minio-callback-1.0.4.tar.gz
Algorithm Hash digest
SHA256 58a6ed15ebe75dd0a874d1ef9075d66cdf3ef720dc46a2297247dadf0503fe9e
MD5 41e53f848e5bf35c2fe54eae95bef0c4
BLAKE2b-256 01a3ac6db35234729ad88d486277edb816616183a968cfb14d5e1a5bc270b9d9

See more details on using hashes here.

File details

Details for the file pl_minio_callback-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: pl_minio_callback-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.5.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.8.0 tqdm/4.61.1 CPython/3.7.3

File hashes

Hashes for pl_minio_callback-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7fbd32c3f1e33d6e9af20cac3433182089b459f57ea47414157e5f3cf2434e57
MD5 f143bddaa7ed9f6445c8d842fd9fc706
BLAKE2b-256 c4f607fc4d17144e30f8b0207dff5e38791b2214946c775cebc7b2748775a750

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