0

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 file as name 'fn_model' locally.

How to copy or move local file to gcp bucket storage with a variable name?

Ling
  • 349
  • 5
  • 15

1 Answers1

0

If you want the value of the variable to be used in your shell command, I think you'll need to prefix it with a dollar sign, e.g. $fn_model.

See this question.

mhouglum
  • 2,468
  • 13
  • 21