Error Response is this,
"message": "Error when deserializing class 'SpatialDropout1D' using config={'name': 'spatial_dropout1d', 'trainable': True, 'dtype': 'float32', 'rate': 0.4, 'noise_shape': None, 'seed': None}.\n\nException encountered: SpatialDropout1D.init() got an unexpected keyword argument 'trainable'"
using keras==3.3.3 tensorflow=2.16.1
from tensorflow.keras.models import load_model
model2 = load_model_from_s3(settings.BUCKET_NAME_TEST, settings.MODEL_KEY_TEST, load_model)
def load_model_from_s3(bucket_name, model_key, load_model):
"""Load model from S3"""
client = boto3.client('s3')
with tempfile.TemporaryDirectory() as tmpdir:
model_path = os.path.join(tmpdir, 'model.h5') # Create a file path
client.download_file(bucket_name, model_key, model_path) # Download to that file path
model = load_model(model_path) # Load the model from the file path
print('Model loaded successfully')
return model
should i change the version ?