Detectron2 Setup.py错误在Colab笔记本中用于稳健CVD



我遇到这个错误:

ERROR: Command errored out with exit status 1: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/root/detectron2/setup.py'"'"'; __file__='"'"'/root/detectron2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

当尝试通过Google Colab安装Dectron2时。我正在Facebook的Robust CVD的Colab笔记本中尝试这样做,并将OpenCV contrib python从3.4.2.16版本更改为3.4.2.17版本。这是GitHub repo的链接:https://github.com/facebookresearch/robust_cvd关于如何解决这个问题有什么想法吗?

尽管您没有提供如何获得错误的详细信息,但我已经尝试在Colab上安装Detectron2,如下所示,它可以工作:

# install dependencies: 
!pip install pyyaml==5.1
# check pytorch installation: 
import torch, torchvision
print(torch.__version__, torch.cuda.is_available())
# clone the repo in order to access pre-defined configs in PointRend project
!git clone --branch v0.6 https://github.com/facebookresearch/detectron2.git detectron2_repo
# install detectron2 from source
!pip install -e detectron2_repo
# See https://detectron2.readthedocs.io/tutorials/install.html for other installation options
You may need to restart your runtime prior to this, to let your installation take effect
# Some basic setup:
# Setup detectron2 logger
import detectron2
from detectron2.utils.logger import setup_logger
setup_logger()
# import some common libraries
import numpy as np
import cv2
import torch
from google.colab.patches import cv2_imshow

然后你就可以继续你的代码了。

最新更新