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

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

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5720483.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存