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 program connects to an S3-compatible object storage server, make a bucket on that server, and upload a file to the bucket.

You need the following items to connect to an S3-compatible object storage server:

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pl-minio-callback-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 869d82f194ac25614b556d0ab5b69be03fefa51860ad0fb12498b7281ea9b84a
MD5 b5dff87094ed21fde8944655f0f74c2a
BLAKE2b-256 c1ef3a5308ddc1dbe84aba1d65373e193dd8ca5d53d0707e93312b03f709d718

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pl_minio_callback-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cc769580dca959f9f07be287fe3dc515a9189ddbf578c64db30e3379ddeaf1c
MD5 c8f2f7eb091a5b1207b630cd01939d9e
BLAKE2b-256 c59597276e2372b29e965517d106a9c366dcd1ae12c2e29b9a7ed2bd0891a213

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