O'Reilly logo

Hands-On Serverless Deep Learning with TensorFlow and AWS Lambda by Rustem Feyzkhanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Solutions for issues with deploying Python frameworks on AWS Lambda

There are a number of ways as to how we can reduce the package size. Here are the solutions for the issues in question:

  • We can compress the shared libraries; this usually enables us to get the best reduction of size.
  • We can remove the .pyc files as they do not influence the library work.
  • Next, we can remove tests and visualization folders from the libraries as they are not useful in production.
  • Next, we can remove libraries that already exist on AWS Lambda.
  • Finally, we can check and remove the libraries that aren't used during execution, for example, wheel or PIP libraries.

Now, in the following code, there is the part that finds and compresses all shared libraries. Then, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required