1

I stored pre-trained deep learning models into s3 buckets and then I am trying to access from python and load model using tensor flow but I am getting an error. Where am I going wrong? What is the best way to load?

s3 = boto3.resource(
    service_name='s3',
    region_name='XXX',
    aws_access_key_id='XXXX',
    aws_secret_access_key='XXXXXX')
path = 's3://bucket/gaussian/gaussian_om.model'
classifier = tf.keras.models.load_model(path,
                                   custom_objects=None,
                                   compile=True)

Error:-

OSError: Unable to open file (unable to open file: name = 's3://bucket/gaussian/gaussian_om.model', errno = 22, error message = 'Invalid argument', flags = 0, o_flags = 0)

files in gaussian_om.model

 -variables
 -keras_metadata.pb
 -saved_model.pb
gm tom
  • 131
  • 8
  • Does this answer your question? [How to write/load machine learning model to/from S3 bucket through joblib?](https://stackoverflow.com/questions/62941174/how-to-write-load-machine-learning-model-to-from-s3-bucket-through-joblib) – Anon Coward Aug 18 '21 at 15:56
  • Could you try again with saving and loading procedure mentioned in this gist. https://gist.github.com/ramdesh/f00ec1f5d01f03114264e8f3d0c226e8 –  Sep 01 '21 at 02:08

0 Answers0