adnanmuttaleb
adnanmuttaleb

Reputation: 3624

How to access Google bucket files using python tensorflow?

If I want to access Google bucket files using python during training job on Google Machine Learning engine (not locally). What is the correct approach from the following choices (if any)?

the first choice is clearly much easier, if it is valid, does it requires special set up such as: setting specific bucket permissions or default storage class.

best regards.

Upvotes: 0

Views: 561

Answers (1)

adnanmuttaleb
adnanmuttaleb

Reputation: 3624

Neither this or this. One should use the tensorflow Gfile module as follow:

import tensorflow as tf
with tf.gfile.GFile("gs://bucket/file", "r") as f:
        content = f.read()

Upvotes: 2

Related Questions