Course Wiki
Preparing a Docker image — Machine Learning Zoomcamp Module 9
Refer to updates.md for info on running TF lite in 2024.
Related Pages
Machine Learning Zoomcamp › Module 9: Serverless Deep Learning › Preparing a Docker image
Notes
Refer to updates.md for info on running TF lite in 2024.
Using pip install for TF-Lite binaries
When using pip to install the compiled binary, make sure you use the raw file, not a link to the github page.
Correct:
pip install https://github.com/alexeygrigorev/tflite-aws-lambda/raw/main/tflite/tflite_runtime-2.14.0-cp310-cp310-linux_x86_64.whl
(Note /raw/ in the path)
Also correct:
pip install https://github.com/alexeygrigorev/tflite-aws-lambda/blob/main/tflite/tflite_runtime-2.14.0-cp310-cp310-linux_x86_64.whl?raw=true
The wheel file above is for Python 3.10. Check other available compiled TF lite versions here.
Not correct - won’t work:
pip install https://github.com/alexeygrigorev/tflite-aws-lambda/blob/main/tflite/tflite_runtime-2.14.0-cp310-cp310-linux_x86_64.whl
If the file is incorrect, you’ll get an error message like that:
zipfile.BadZipFile: File is not a zip file
ENTRYPOINT vs CMD
This link explains the difference between them: https://stackoverflow.com/a/34245657
ENTRYPOINTspecifies a command that will always be executed when the container starts.CMDspecifies arguments that will be fed to theENTRYPOINT.
In case of the lambda base pacakge, the authors already specified the entrypoint and we only need to overwrite the arguments passed to the entrypoint,
| ⚠️ |
The notes are written by the community. If you see an error here, please create a PR with a fix. |
Key concepts
Related notes
- mlz-m01-setting-up-the-environment
- mlz-m05-deployment-to-the-cloud-aws-elastic-beanstalk-op
- mlz-m05-environment-management-docker
- mlz-m05-intro-session-overview
- mlz-m05-python-virtual-environment-pipenv
- mlz-m09-api-gateway-exposing-the-lambda-function
- mlz-m09-aws-lambda
- mlz-m09-creating-the-lambda-function
- mlz-m09-explore-more
- mlz-m09-introduction-to-serverless
- mlz-m09-preparing-the-code-for-lambda
- mlz-m09-python-3-12-vs-tf-lite-2-17
- mlz-m09-summary
- mlz-m09-tensorflow-lite
- mlz-m10-creating-a-pre-processing-service
- mlz-m10-introduction-to-kubernetes
- mlz-m10-overview
- mlz-m10-running-everything-locally-with-docker-compose