Saltar al contenido

OpenCV for Sagemaker

0

How can I import OpenCV in a python sagemaker notebook? Every time I try I always get an error with the following line : "import cv2"

preguntada hace un año490 visualizaciones
1 Respuesta
1

To import OpenCV in a Python SageMaker notebook, you can follow these steps:

Install the
opencv-python-headless
package instead of the regular
opencv-python
package. This headless version of OpenCV does not require additional GUI libraries, which can cause issues in a SageMaker notebook environment.

%pip install opencv-python-headless

After installing the package, you should be able to import cv2 without any issues

AWS
respondido hace un año
AWS
EXPERTO
revisado hace un año
  • Agree with this but the formatting is a bit off: I think you want your triple-backticks around %pip install opencv-python-headless rather than the preceding block :D

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.