在没有 NVIDIA GPU 的情况下运行 Google 的 Colab 时如何在 Facebook SAM 中设置“设备”?

问题描述 投票:0回答:1
import sys
sys.path.append("..")
from segment_anything import sam_model_registry, SamAutomaticMaskGenerator, SamPredictor

sam_checkpoint = "sam_vit_h_4b8939.pth"
model_type = "vit_h"

**device = "cuda"**

RuntimeError:在您的系统上找不到 NVIDIA 驱动程序。请检查您是否拥有 NVIDIA GPU 并从 http://www.nvidia.com/Download/index.aspx

安装了驱动程序

如何避免这种情况?

import sys
sys.path.append("..")
from segment_anything import sam_model_registry, SamAutomaticMaskGenerator, SamPredictor

sam_checkpoint = "sam_vit_h_4b8939.pth"
model_type = "vit_h"

**device = "cuda"**

RuntimeError:在您的系统上找不到 NVIDIA 驱动程序。请检查您是否拥有 NVIDIA GPU 并从 http://www.nvidia.com/Download/index.aspx

安装了驱动程序

如何避免这种情况?在 Google 的 Colab 中奔跑。

runtime-error google-colaboratory nvidia sam
1个回答
0
投票

您可能没有在运行时启用 GPU。

在 Google Colab 上,选择

Runtime
>
Change Runtime Type
并将
Hardware Accelerator
设置为
GPU

© www.soinside.com 2019 - 2024. All rights reserved.