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

Slowfast环境配置问题 | detectron2安装 error ERROR: Command errored out with exit status 1:

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

Slowfast环境配置问题 | detectron2安装 error ERROR: Command errored out with exit status 1:

简介

Detectron原github地址:https://github.com/facebookresearch/detectron2

Detectron安装指引: https://detectron2.readthedocs.io/en/latest/tutorials/install.html

Detectron介绍:

Detectron2 is Facebook AI Research’s next generation library that provides state-of-the-art detection and segmentation algorithms. It is the successor of Detectron and maskrcnn-benchmark. It supports a number of computer vision research projects and production applications in Facebook.


报错过程

此处采用的是官方安装指引中第二条安装方式,即:

# to install it from a local clone:
git clone https://github.com/facebookresearch/detectron2.git
python -m pip install -e detectron2

但出现报错:

ERROR: Command errored out with exit status 1: /home/xxx/anaconda3/envs/detectron2/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-req-build-yf9eibzp/setup.py’"’"’; file=’"’"’/tmp/pip-req-build-yf9eibzp/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’rn’"’"’, ‘"’"’n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’


解决方案

解决方案来源: https://github.com/facebookresearch/detectron2/issues/1459

具体方案:
①直接通过sudo降级
将gcc降级到低版本,原论坛大多数都是从7.5降级到7.1,实测从7.5降级到5.5也行。

如果是在自己机器上,gcc降级是一个很方便的操作,但鉴于各种原因,可能是租的服务器,或者借用实验室服务器没有降级权限等等原因,这里提供第二种降级思路。

②设置临时变量

鉴于命令行启动程序是在path变量的目录逐个寻找,所以只需要自己开一个目录弄一个执行低版本gcc的连接,名字就叫gcc,然后将这个目录放在path最前面即可完成降级。

mkdir temp-gcc-5
cd temp-gcc-5/
ln -s /usr/bin/gcc-5 gcc
ll
export PATH=/home/name/temp-gcc-5:$PATH
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/725134.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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