Skip to content

Allow preloaded data#13

Open
mdreier wants to merge 4 commits intointo-ai:masterfrom
mdreier:preloaded
Open

Allow preloaded data#13
mdreier wants to merge 4 commits intointo-ai:masterfrom
mdreier:preloaded

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.

1 participant