COVID-19
COVID-19 copied to clipboard
Create AWS Lambda Layer with PyTorch
AWS Lambda have restrictions. PyTorch is too longer. When trying to deploy the project, AWS Lambda reports the out of memory error. PyTorch weighs: 758MB.
There is PyTorch layers with other versions. It could be a problem. We need to control the versions of the dependencies that we are going to use.
An alternative is:
- Create and publish our own layer. With the specifications that requirements the project.
- Take PyTorch from requirements.txt and use it only in development or on Docker.
Related: #18, #20, #29, #30
We can start prototyping with this layer that its publicly available:
arn:aws:lambda:AWS_REGION:934676248949:layer:pytorchv1-py36:2
caveat: its version 1.1 of pytorch while we are using 1.4
I already checked the layer and its working!
and following this tutorial:
https://course.fast.ai/deployment_aws_lambda.html