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
pipinstallkeras-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 classfromkeras_bucket_tensorboard_callbackimportBucketTensorBoard# Create the callback instance, passing the bucket URIbucket_callback=BucketTensorBoard('gs://my-bucket/any_dir')# Train the model with the callbackmodel.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.