1

我正在尝试在 Google Colab 上包含 Detectron2.data。我为 colab 和我的驱动器建立了连接。在那之后:

!pip install pyyaml
!pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.7/index.html

它工作没有任何错误。

我一直在尝试这个;

import numpy as np
import os, json, cv2, random
from google.colab.patches import cv2_imshow


import detectron2
from detectron2.data import MetadataCatalog, DatasetCatalog
from detectron2.utils.visualizer import Visualizer
from detectron2 import model_zoo

但输出是这样的: 在此处输入图像描述

我该如何解决?

4

1 回答 1

1

我这样固定:

!pip install pyyaml==5.1
import torch, torchvision
print(torch.__version__, torch.cuda.is_available())
!gcc --version


import torch
assert torch.__version__.startswith("1.8")   
!pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html
# exit(0)  # After installation, you need to "restart runtime" in Colab. This line can also restart runtime

来自:https ://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5#scrollTo=ZyAvNCJMmvFF

于 2021-06-01T08:03:37.690 回答