装detectron2报错:nvcc fatal : No input files specified; use option --help for more information
装 detectron2[1],开头遇到 ninja
的报错,参考 [2],关掉 ninja
。然后又报了 nvcc
的错:
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [36 lines of output]running developrunning egg_infowriting detectron2.egg-info/PKG-INFOwriting dependency_links to detectron2.egg-info/dependency_links.txtwriting requirements to detectron2.egg-info/requires.txtwriting top-level names to detectron2.egg-info/top_level.txtreading manifest file 'detectron2.egg-info/SOURCES.txt'adding license file 'LICENSE'writing manifest file 'detectron2.egg-info/SOURCES.txt'running build_extbuilding 'detectron2._C' extensioncreating buildcreating build/temp.linux-x86_64-cpython-38creating build/temp.linux-x86_64-cpython-38/homecreating build/temp.linux-x86_64-cpython-38/home/tianyoucreating build/temp.linux-x86_64-cpython-38/home/tianyou/codescreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/datacreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNetcreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2creating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2creating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layerscreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrccreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/ROIAlignRotatedcreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/box_iou_rotatedcreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/cocoevalcreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/deformablecreating build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/nms_rotatedgcc -pthread -B /data/tianyou/miniconda3/envs/detectron2/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include/TH -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include/THC -I/data/tianyou/miniconda3/envs/detectron2/include/python3.8 -c /home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp -o build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++/usr/bin/nvcc -DWITH_CUDA -I/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include/TH -I/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/torch/include/THC -I/data/tianyou/miniconda3/envs/detectron2/include/python3.8 -c /home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.cu -o build/temp.linux-x86_64-cpython-38/home/tianyou/codes/data/MvImNet/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14nvcc fatal : No input files specified; use option --help for more information/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.warnings.warn(/data/tianyou/miniconda3/envs/detectron2/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.warnings.warn(error: command '/usr/bin/nvcc' failed with exit code 1[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
官方的 FAQ[3,4]、issues 和博客都没找到解决方案。但在 [3,4] 看到一句测试:
python -c 'import torch; from torch.utils.cpp_extension import CUDA_HOME; print(torch.cuda.is_available(), CUDA_HOME)'
输出是:
True /usr
但 /usr 根本就不是 CUDA_HOME
啊喂!看 [5],CUDA_HOME
应该形如 /usr/local/cuda 或者 /usr/local/cuda-11.1 这样怼到具体 cuda 目录的才对。于是初步测试 nvcc
命令:
- 运行
nvcc -V
,报错:nvcc fatal : No input files specified; use option --help for more information
- 运行
nvcc --help
,也报这个错 ↑\uparrow↑。
有毒吧?看 whereis nvcc
:
nvcc: /usr/bin/nvcc /etc/nvcc.profile /usr/share/man/man1/nvcc.1.gz
而又在 detectron2/detectron2/utils/collect_env.py 中搜到一句:
nvcc = os.path.join(CUDA_HOME, "bin", "nvcc")
猜测可能是要用 /usr/local/cuda/bin/nvcc 来执行才行,而从上面报错来看,用的是裸的 nvcc
命令,并没有指定 cuda 目录下的 nvcc,再用 /usr/bin/nvcc -V
、/usr/bin/nvcc --help
可以复现前面的奇怪报错,确定安装的时候用的是 /usr/bin/nvcc。
把它改成用 /usr/local/cuda/bin/nvcc 试试:
# 让 shell 先搜到 /usr/local/cuda/nvcc
# 就可以避免使用 /usr/bin/nvcc
PATH=/usr/local/cuda/bin/:$PATH
$CONDA_BIN/python -m pip install -e detectron2
结果就成功了。
installing script
我安装 detectron2 的脚本:
#!/bin/bash# facebookresearch/detectron2
# - https://github.com/facebookresearch/detectron2
# installation
# - https://detectron2.readthedocs.io/en/latest/tutorials/install.htmlCONDA_P=~/miniconda3
ENV=detectron2
if [ ! -d $CONDA_P/envs/$ENV ]; thenconda create --name $ENV python=3.8 -y
fi
CONDA_BIN=$CONDA_P/envs/$ENV/bin$CONDA_BIN/pip install torch==1.8.2 torchvision==0.9.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111
$CONDA_BIN/pip install opencv-python# 从 github 下
# git clone https://github.com/facebookresearch/detectron2.git
echo 从 gitee 的公开中转仓下(加速)
git clone https://gitee.com/xoxleoxox/detectron2# 停用 `ninja` 避坑:改 *detectron2/setup.py*
# ref: https://blog.csdn.net/jiankangyq/article/details/121879936
sed -i "s/BuildExtension\}/BuildExtension\.with_options\(use_ninja\=False\)\}/" detectron2/setup.pyif [ -d detectron2/build ]; then rm -rf detectron2/build/ **/*.so; fi# BUG: 默认的 `nvcc -> /usr/bin/nvcc` 连 `nvcc -V`、`nvcc --help` 都会报错!
# 换用 */usr/local/cuda/bin/nvcc*
PATH=/usr/local/cuda/bin/:$PATH
$CONDA_BIN/python -m pip install -e detectron2if [ -d detectron2/build ]; then rm -rf detectron2/build/; fi
References
- facebookresearch/detectron2
- 安装detectron2的一些坑
- Common Installation Issues
- facebookresearch/detectron2/INSTALL.md
- 安装detectron2 报错
装detectron2报错:nvcc fatal : No input files specified; use option --help for more information相关推荐
- nvcc fatal : No input files specified; use option --help for more information
记录一下出现的不可思议的bug nvcc fatal : No input files specified; use option --help for more information 首先看看 ...
- git第一次提交代码到码云,git pull 报错:fatal: refusing to merge unrelated histories
第一次提交的步骤: 1.进入项目目录,执行 git init 2.连接远程仓库 git remote add origin 远程仓库地址(从码云乎哟这github上复制地址即可) 3.报错:git p ...
- 在Jetson Xavier NX上安装torchvision编译报错:fatal error: libavcodec/avcodec.h: No such file or directory
文章目录: 1 问题原因说明 2 解决方法 1 问题原因说明 1.尝试安装torchvision 在Jetson NX设备上安装torch的版本是1.6.0版本,对应安装torchvision版本应该 ...
- PHP连接MySQL报错:Fatal error: Call to undefined function mysql_connect()之解决方法
来源:http://www.blogjava.net/koradji/articles/336713.html [问题描述] PHP测试连接MySQL的程序如下: <?php $host='lo ...
- 更新Composer依赖报错处理Fatal error: Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRe...
更新Composer依赖报错处理 Fatal error: Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRepos ...
- Mac-安装Homebrew报错error: could not lock config file .git/config:
Mac-安装Homebrew报错error: could not lock config file .git/config:
- 【git clone 报错】fatal: unable to access ‘https://github.com/zimeng303/React.git/‘: Failed to connect
[git clone 报错]fatal: unable to access 'https://github.com/zimeng303/React.git/': Failed to connect t ...
- python中使用pip安装报错:Fatal error in launcher... 解决方法
python中使用pip安装报错:Fatal error in launcher... 解决方法 参考文章: (1)python中使用pip安装报错:Fatal error in launcher.. ...
- idea报错:fatal: –author ‘user@mail.com’ is not ‘Name ’ and matches no existing author
需求阐述 在本地项目上传到gitlab时,到了Commit Directory这一步,控制台报错:fatal: –author 'user@mail.com' is not 'Name ' and m ...
最新文章
- mysql 按重复排序_php-按日期排序并允许重复的日期时,获取MySQL中的上一个和下一个记录...
- 把二叉搜索树转换为累加树
- Python 使用CORS跨域资源共享解决flask服务器跨域问题、浏览器同源策略
- 应该怎么学python_什么样的人适合学Python,应该怎么学?
- 上传文件至数据库并下载
- nginx nodejs环境配置_服务器环境配置安装(mysql+redis+nodejs+nginx)
- 铠侠 RC10 固态硬盘寿命暴力写入测试:1100pe 毫发无损
- 游族网络董事长林奇收监管函 涉嫌违规减持
- windows共享关闭密码保护是灰色的
- Redis在本地安装与启动
- eNSP 华为模拟器更新说明
- 在ubuntu下安装Dynamips
- python scrapy框架 简书_7、Python Scrapy框架,简单学习
- 【Web前端】京东商城项目实战HTML+CSS+JavaScript
- 项目管理——如何制定生产计划控制生产进度
- 人体神经系统分布图图片,神经系统分布图片高清
- 专注与拓展-向携程学习
- java编译release版本断言_关于Debug和Release之本质区别
- WebDAV之葫芦儿•派盘+麻雀记
- 和老BIOS说永别 EFI BIOS技术解析
热门文章
- 国家信息安全等级保护制度第三级要求
- 百度网盘加速无限试用_百度网盘上线 单日/单次 加速功能,最低仅需 2 块钱
- 计算机房 危险源辨识,消防安全重点部位不仅要根据火灾危险源的辨识来确..._消防考试_帮考网...
- nodejs入门--node的下载与安装
- Oracle19c数据库下载及安装步骤(详细)以及连接Navicat和PLSql
- python3入门笔记
- 课外时间学点历史知识~
- 微信公众号图文如何插入Excel表格
- 星起航:抖音小店如何提高店铺评分?
- v-model 原理及使用