aws / deep-learning-containers

AWS Deep Learning Containers are pre-built Docker images that make it easier to run popular deep learning frameworks and tools on AWS.
https://docs.aws.amazon.com/deep-learning-containers/latest/devguide/what-is-dlc.html
Other
1k stars 462 forks source link

[bug] OpenCV is not installed properly for Inference container #1813

Open maxim-gapchenko opened 2 years ago

maxim-gapchenko commented 2 years ago

Checklist

Concise Description: Need to use opencv with pytorch inference. By default when import cv2 got ModuleNotFoundError: No module named 'cv2'

If add opencv-python-headless==4.2.0.34 to the requirements.txt, got following error: ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory (If do not specify opencv version, there is another error)

DLC image/dockerfile: 301217895009.dkr.ecr.us-west-2.amazonaws.com/sagemaker-neo-pytorch:1.5.1-inf-py3

Current behavior:

Expected behavior:

Additional context:

maxim-gapchenko commented 2 years ago

Tried to extend this docker container, but got access denied error. Looks like this container has incorrect policy.

Here is code to reproduce the error. aws ecr get-login-password --region "us-west-2" | docker login --username AWS --password-stdin "301217895009.dkr.ecr.us-west-2.amazonaws.com" docker pull "301217895009.dkr.ecr.us-west-2.amazonaws.com/sagemaker-neo-pytorch:1.5.1-inf-py3"

code works without any problems for another sample container: 520713654638.dkr.ecr.us-west-2.amazonaws.com/sagemaker-pytorch:0.4.0-cpu-py3