Keras Bucket Tensorboard Callback
A Keras Callback that uploads your Tensorboard logs to a Cloud Bucket
Currently, only Google Cloud Platform Storage is supported. Very little effort is needed to support AWS S3, so feel free to contribute to this project.
Installation
pip install keras-bucket-tensorboard-callback
Basic usage
The following example trains uploads the Tensorboard logs to you GCP Storage
bucket my-bucket
, inside the directory any_dir
:
# Import the class
from keras_bucket_tensorboard_callback import BucketTensorBoard
# Create the callback instance, passing the bucket URI
bucket_callback = BucketTensorBoard('gs://my-bucket/any_dir')
# Train the model with the callback
model.fit(
x=X,
y=Y,
epochs=20,
callbacks=[bucket_callback]
)
Make sure you have access to the provided bucket. For GCP, you should have
the GOOGLE_APPLICATION_CREDENTIALS
env set, pointing to your json
key
file.
Viewing the results on TensorBoard
With tensorboard installed your environment, run:
tensorboard --logdir=gs://my-bucket/any_dir
The TensorBoard will show your metrics and graphs saved on the bucket.