Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keras dependencies needed for prediction only in AWS Lambda

I'm trying to package my trained Keras classifier models (Theano backend) and their HDF5 weights as AWS Lambda functions that process classification requests coming from an API. Lambda has a 50MB limit for the zip file that contains the function code and dependencies, so I'm wondering whether any of the dependencies needed for training are not needed for prediction, so that I can leave them out of the Lambda zip file. Right now I'm just squeaking by at ~45MB with all dependencies (numpy, scipy, etc.), but I'd like to drop any dead weight if possible.

like image 489
KeepingItClassy Avatar asked Sep 04 '16 07:09

KeepingItClassy


1 Answers

You can strip your binaries to save space

find . | xargs strip
like image 59
ilan Avatar answered Oct 06 '22 18:10

ilan