スキップしてコンテンツを表示

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"

質問済み 1年前492ビュー
1回答
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
回答済み 1年前
AWS
エキスパート
レビュー済み 1年前
  • 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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ