Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow preloaded data #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Allow preloaded data #13

wants to merge 4 commits into from

Conversation

mdreier
Copy link

@mdreier mdreier commented Apr 2, 2020

When running machine learning programs on Google Cloud TPUs (e.g. from Google Colab), the data must be stored on Google Cloud Storage. The current implementation uses methods, especially tf.keras.utils.get_file, which do not support this.

The pull request achieves two things:

  • Replace methods that do not support GCS paths by those which do
  • Allow callers to specify a path where data is stored. In this case it will not be downloaded
train_data, test_data, classes = ImageWoof.load_data('gs://my-gcs-bucket')

Example

This workbook can be run either on GPU or on TPU.

Possible Improvements

  • Replace tf.keras.utils.get_file with another method which allows storage directly into GCS
  • Error handling when storage directory does not contain the required data

mdreier and others added 4 commits April 3, 2020 13:56
Prevents call to download and preprocessing when data is already
available.
Library tensorflow.io.gfile uses Tensorflow's C layer to access data.
This includes support for some file systems (e.g. for Google Cloud
Storage) which are not supported by Python's OS libraries.
Some file systems may add trailing slashing when listing folder contents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant