KeyError: 'sam' error
I am trying to pass an model to this model like this
with open("/root/aws-sam/02.JPG", "rb") as f:
data = f.read()
response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME,
ContentType='image/jpeg',
Body=data)
result = json.loads(response['Body'].read().decode())
I am getting this error
2023-10-26T09:42:33.354-07:00
Copy
2023-10-26T16:42:33,265 [INFO ] W-9000-facebook__sam-vit-large-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - raise KeyError(key)
2023-10-26T16:42:33,265 [INFO ] W-9000-facebook__sam-vit-large-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - raise KeyError(key) AllTraffic/i-0dad3e9d16762a67f
2023-10-26T09:42:33.354-07:00
Copy
2023-10-26T16:42:33,265 [INFO ] W-9000-facebook__sam-vit-large-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - KeyError: 'sam'
2023-10-26T16:42:33,265 [INFO ] W-9000-facebook__sam-vit-large-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - KeyError: 'sam' AllTraffic/i-0dad3e9d16762a67f
2023-10-26T09:42:37.363-07:00
Copy
2023-10-26T16:42:33,265 [INFO ] W-9000-facebook__sam-vit-large-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - Model facebook__sam-vit-large loaded io_fd=966296fffe2e23f7-00000015-00000000-a9415483c6ddb70e-6cd401cc
2023-10-26T16:42:33,265 [INFO ] W-9000-facebook__sam-vit-large-stdout com.amazonaws.ml.mms.wlm.WorkerLifeCycle - Model facebook__sam-vit-large loaded io_fd=966296fffe2e23f7-00000015-00000000-a9415483c6ddb70e-6cd401cc
probably you just need to just adding the latest transformers version (transformers==4.25.1) to the requirements.txt file .
The issue is here:
https://www.kaggle.com/code/vinayakshanawad/bring-your-bert-model-to-aws-sagemaker