Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi! I Am Trying To Download Data From Gs Using

Hi! I am trying to download data from GS using StorageManager.get_local_copy() . It works fine when I point it to a file i.e gs://bucket/dataset/image.png but fails if I want to download the whole dir gs://bucket/dataset . It prints a 404 error with a link that redirects to a http://storage.googlepis.com message: “Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.”

  
  
Posted 4 years ago
Votes Newest

Answers 7


Yes! How can I help? AgitatedDove14

  
  
Posted 4 years ago

Maybe we should add it to Storage Manager? What do you think?

  
  
Posted 4 years ago

Nice!!!!!

  
  
Posted 4 years ago

AgitatedDove14 update here! Something like this should work:
from trains import StorageManager from trains.storage.helper import StorageHelper bucket = 'gs://bucket' helper = StorageHelper.get(bucket) remote_files = helper.list('folder') for f in remote_files: StorageManager.get_local_copy(bucket + "/" + f)the * gives [] results since one the list method startswith is used which uses it as a string and not as a wildcard

  
  
Posted 4 years ago

You might need to play around a bit, it might be that StorageHelper.get(' gs://bucket ') and then helper.list('folder/*')
Let me know what worked 🙂

  
  
Posted 4 years ago

Thanks AgitatedDove14 !

  
  
Posted 4 years ago

Hi GrievingTurkey78 ,
Yes this is a per file download, but I think you can list the bucket and download everything
Try:
from trains import StorageManager from trains.storage.helper import StorageHelper helper = StorageHelper.get('gs://bucket/folder') remote_files = helper.list('*') for f in remote_files: StorageManager.get_local_copy(f)

  
  
Posted 4 years ago
977 Views
7 Answers
4 years ago
one year ago
Tags