基于pytorch和cuda版本的Detectron2安装

olhwl3o2  于 2023-05-29  发布在  其他
关注(0)|答案(2)|浏览(208)

我是相当新的对象检测和我试图安装Detectron2的colab。我的Pytorch版本是1.12,而Cuda版本是11.2。我参考了网站https://detectron2.readthedocs.io/en/latest/tutorials/install.html来找到最合适的安装命令,但我不知道该选择哪一个,因为那里既没有pytorch版本,也没有Cuda版本。

qybjjes1

qybjjes11#

你需要创建一个Python环境,例如并下载所有兼容的软件包。

gab6jxml

gab6jxml2#

下面是他们在colab官方教程中安装detectron2的方法:

!python -m pip install pyyaml==5.1
import sys, os, distutils.core
# Note: This is a faster way to install detectron2 in Colab, 
but it does not include all functionalities.
# See https://detectron2.readthedocs.io/tutorials/install.html 
for full installation instructions
!git clone 'https://github.com/facebookresearch/detectron2'
dist = distutils.core.run_setup("./detectron2/setup.py")
!python -m pip install {' '.join([f"'{x}'" for x in dist.install_requires])}
sys.path.insert(0, os.path.abspath('./detectron2'))

# Properly install detectron2. (Please do not install twice in both ways)
# !python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'

你可以在这里找到整个笔记本:https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5#scrollTo=FsePPpwZSmqt

相关问题