Im working on S3 , I ve my model saved in S3 as PTH file , but when i try to load it I get the following error
TypeError: new(): invalid data type 'bytes'
My code is:
s3 = boto3.resource('s3') bucket_name = 'bucket_name' key = 'network/model/model.pth' obj = s3.Object(bucket_name,key) body = obj.get()['Body'].read() state = torch.as_tensor(body)
I am assuming torch cant load model as bytes …I am new to AWS , so anyone can help me with a solution how to load the model weights from S3 bucket