0

I've followed these instructions from here to get my data being read from a google storage bucket by the google ML engine. - https://cloud.google.com/ml-engine/docs/how-tos/working-with-data

But cannot seem to get my code to read from the bucket after assigning the permissions to my project as per the instructions above..

This is what the code looks like, the error showing up is that the files are unable to be found

def get_model():
    global MODEL
    if MODEL is None:
        MODEL = kenlm.Model('gs://deepspeech/data/lm/lm.binary')
    return MODEL

def words(text):
    "List of words in text."
    return re.findall(r'\w+', text.lower())

# Load known word set
with open('gs://deepspeech/spell/words.txt') as f:
    WORDS = set(words(f.read()))
vr9494
  • 76
  • 6
  • Just so we're on the same page, is there a bucket named deepspeech, and does it contain an object named "data/lm/lm.binary"? – Brandon Yarbrough May 09 '17 at 21:45
  • Possible duplicate of [reading files in google cloud machine learning](http://stackoverflow.com/questions/42761075/reading-files-in-google-cloud-machine-learning) – rhaertel80 May 09 '17 at 22:22

1 Answers1

1

You cannot use open for files on GCS. See this answer for more details.

Community
  • 1
  • 1
rhaertel80
  • 8,254
  • 1
  • 31
  • 47