Chapter 106
9.5 Preparing a Docker image
9.5 Preparing a Docker image
Note: the materials in this unit are outdated.
Refer to the ONNX Workshop for the up-to-date materials.
![]()
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=trueThe 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.whlIf the file is incorrect, you'll get an error message like that:
zipfile.BadZipFile: File is not a zip fileENTRYPOINT 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,
