When you add the opencv-python library and import the cv2 module, you might encounter the following error:
Exception: Error in importing module libGL.so.1: cannot open shared object file: No such file or directory
This issue occurs because the base Docker image does not include the necessary dependencies for OpenCV. To resolve this, you need to use a Docker image that supports OpenCV.
For CPU instances:
public.ecr.aws/w8k8y6b6/qwak-base:0.0.29-cpu-opencvFor GPU instances:
public.ecr.aws/w8k8y6b6/qwak-base:0.0.14-gpu-opencv
You can update the base image in one of two ways:
Via Command Line
Add the
--base-imageparameter when building your model:frogml models build --base-image 'public.ecr.aws/w8k8y6b6/qwak-base:0.0.14-gpu-opencv'
Via YAML Configuration
Update your YAML configuration file with the base image settings. Refer to our Build Configurations page for more details.
build_env: docker: base_image: public.ecr.aws/w8k8y6b6/qwak-base:0.0.14-gpu-opencv