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 user 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.2.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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pl-minio-callback-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 bff8ab5e3c8f8caa6e9400a1962d478ee609989d3716f58bf6d0da7b92742284
MD5 84fd2beed219feac4cb035a7e7c31504
BLAKE2b-256 bfada8a74d35bf6da9dccaba1f96b1ef019d6e3cb853651f4decd9e17f709036

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pl_minio_callback-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40f3a3e2fad81d9ec44a20a5a617cf5b3e8808aa67c1c4ca0b54625aeae2c0ce
MD5 18a9a555f314b1037d65450637d8ba94
BLAKE2b-256 d1eef02e8f4d6f9f3709feaae126dc0f10a0c56cab69789979fce5842564d5eb

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