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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pl-minio-callback-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 41e286ae9458d15e8d978cb67c5e17b64e2064aeb6428f869a07384aab2f0c20
MD5 bc2d8f8c37da526d18ca4fb4e8e72503
BLAKE2b-256 f44effaac6bc0883bc3ad7c7cf9b078dfa2e24491f3bb4d9c422239268bfc883

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pl_minio_callback-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 deaedd4771ede1d01820655a81944ec6d5c180a076d4210ce6288ef4475de883
MD5 80eda40c6d8c8eebbba631a7e4627e89
BLAKE2b-256 c7858f79da9397a70ca541a828224f56b3a66499e20ef205f6a6707ff38b3738

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