栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

Detectron2 windows系统安装

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Detectron2 windows系统安装

1.conda create -n detectron2 python=3.8 -y

2.conda activate detectron2

3.在Pytorch官网中找到对应的pytorch版本以及CUDA版本,要求pytorch版本大于1.8

pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

这个是我按照的配置,pytorch=1.8.1 cuda=10.2

4.python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' 

若出现以下错误:error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ 则证明没有安装Microsoft Visual C++。

Microsoft C++ Build Tools - Visual Studio进入这个网址下载安装包

 尽量不要安装在C盘下,会占用至少10G空间

安装完成之后我们需要在Microsoft Visual C++下打开命令行窗口,不然会报如下错误:error: command 'cl.exe' failed: No such file or directory

错误原因是由于没有配置系统变量PATH,导致无法找到cl.exe程序,如果使用自带的Powershell则自动配置该环境变量

在cmd中输入cl.exe,出现以下信息则代表找到该执行程序

 接着我们需要输入以下两行命令,否者会出现如下错误:UserWarning: It seems that the VC environment is activated but DISTUTILS_USE_SDK is not set.This may lead to multiple activations of the VC env.Please set `DISTUTILS_USE_SDK=1` and try again.

SET DISTUTILS_USE_SDK=1
call "F:Microsoft_visual_studioBuildToolsVCAuxiliaryBuildvcvars64.bat"

注意第二行代码vcvars64.bat位置是由安装Microsoft visual C++位置所决定的,不要照搬

5.最后输入:python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'

则自动安装detectron2依赖包

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/767680.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号