How to Leverage E2E Object Storage(EOS) for your TensorFlow Projects


To employ high-performance object storage in the design of your AI/ML pipelines. E2E Object Store (EOS) is a simple, cost-effective, and S3-compatible storage service that enables you to store, backup and archive large amounts of content for your web apps or data for AI/ML pipelines. Our S3 Compatible REST API enables data access from anywhere on the internet or within your private network.

One of the frameworks that have emerged as the lead industry standards is Google’s TensorFlow. Highly versatile, one can get started quickly and write simple models with their Keras framework. If you seek a more advanced approach TensorFlow also allows you to construct your own machine learning models using low-level APIs. No matter what strategy you choose, TensorFlow will make sure that your algorithm gets optimized for whatever infrastructure you select for your algorithms - whether it’s CPU’s, GPU’s or TPU’s.

Tensorflow supports reading and writing data to object storage. EOS is an object storage API which is nearly ubiquitous, and can help in situations where data must accessed by multiple actors, such as in distributed training.

This document guides you through the required setup, and provides examples on usage. Download the dataset in your system or in cloud server and upload it to our EOS using MinIO Client.


Here we are choosing an example dataset to upload it to the EOS.

#curl -O
#mc mb e2e/datasets
#mc cp aclImdb_v1.tar.gz e2e/datasets/

To download above dataset from MinIO using MinIO Python client SDK which is available in minio-py

The MinIO Python Client SDK provides simple APIs to access any S3 compatible object storage server.


  • Python 2.7 or higher
  • Tensorboard
  • Tensorflow
  • TensorFlow-hub
  • Object Storage

Options to download minio-python client SDK

Download from pip

#pip install minio

Download from pip3

#pip3 install minio

Download from source

#git clone
#cd minio-py
#python install


Now, lets start writing example config to download and uncompress the dataset under /tmp in a file

In our tutorial we have taken a part of code to make understand how to use minio-client sdk with python-based framework Tensorflow to connect with MinIO the same way you can use this to the full-size code in production.

import tensorflow as tf
import tensorflow_hub as hub
from minio import Minio
from minio.error import ResponseError

random_seed = 44
batch_size = 128
datasets_bucket = 'datasets'
preprocessed_data_folder = 'preprocessed-data'
tf_record_file_size = 500
# Set the random seed

# How to access MinIO
minio_address = ''
minio_access_key = 'xxxxxxxxxxxxxxxx'
minio_secret_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'

from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,

# Initialize minioClient with an endpoint and access/secret keys.

minioClient = Minio(minio_address,

except ResponseError as err:

#Now let's uncompress the dataset to a temporary folder (/tmp/dataset) to preprocess our data
import tarfile, glob
extract_folder = f'/tmp/{datasets_bucket}/'

with"/tmp/dataset.tar.gz", "r:gz") as tar:

If you run python script then the dataset will get downloaded and uncompressed under /tmp.

# python

Next to this you can start building the further stages of machine learning like pre-processing and training of data using Tensorflow by fetching and sending data to Object storage. According to your code flow, you can tweak the code with our above given format to access MinIO storage buckets.

To Monitor Object Notifications Events

Running a single command we can start monitoring data flow between Tensorflow and MinIO.

# mc watch e2e/datasets


By separating storage and compute, one can build a framework that is not dependent on local resources - allowing you to run them on a container inside Kubernetes. This adds considerable flexibility.I hope that this tutorial is useful! Once again, For more details related to E2E Object Storage(EOS)