Category : gsutil

I need to copy keras model from local to gcp storage bucket, my code is as below: output_path = ‘gs://bucket/folder/’ output_prefix = ‘modelprefix_’+str(num)+’_’ model.save(‘_model.h5’) fn_model = output_path + output_prefix + ‘_model.h5’ !gsutil -m cp ‘_model.h5’ fn_model However, the above code was not able to move saved model to bucket storage, instead it just saved another ..

Read more

I want to: Access all GCP projects linked to my google account. Get all buckets that contain the word foobar in their name. Retrieve some of the metadata from the ones provided by Google (Creation time, Update time, Storage class, Content-Length, Content-Type, Hash (crc32c), Hash, ETag, Generation, Metageneration, ACL, TOTAL) for example Creation time and ..

Read more

In my Case, I want to upload all of pdf file to google cloud storage. So I use google-sdk with pytho subprocess for practice instead of "google.cloud.storage API". But there is an error below: Code: from subprocess import Popen def subprocess_cmd(command): print(f’$>: {command}’) process = Popen(command, stdout=subprocess.PIPE, executable=’/bin/bash’, shell=True) proc_stdout = process.communicate()[0].strip() print(proc_stdout.decode("utf-8")) Exec Function: ..

Read more