解决......lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory报错问题

2023-05-16

文章目录

  • 1. 问题描述
    • 1.1 构建的环境:完全按照要求
    • 1.2 编译出错的具体情况
      • 1.2.1 编译make.sh前必要的修改
      • 1.2.2 报错信息
  • 2.解决方法
    • 2.1 我的解决方法
    • 2.2 总结

1. 问题描述

本人在编译Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector一文的开源代码https://github.com/fanq15/FSOD-code时遇到了报错:
......lib/include/THC/THCGeneral.h:12:18:fatal error: cuda.h: No such file or directory

1.1 构建的环境:完全按照要求

pytorch0.4.1
torchvision>=0.2.0
cython
matplotlib
numpy
scipy
opencv
pyyaml
3.12
packaging
pandas
pycocotools
CUDA=9.0

  1. 本人使用实验室公用的工作站,所以我不能把CUDA9.0安装在usr/local/下(以免影响他人使用特定版本的CUDA),只能安装在我的/home目录下:
    CUDA一般的安装位置:/usr/local/cuda-9.0/
    我的CUDA安装位置:/home/hongze/cudas/cuda-9.0/
  2. 安装多个CUDA之后一定要查看nvcc的版本:
(base) hongze@lab-PowerEdge-T630 ~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176
  1. 如果版本不是需要的版本,需要在.bashrc文件更改,例如我安装了两个版本的CUDA:
(base) hongze@lab-PowerEdge-T630 ~/cudas$ ls
cuda-10.1  cuda9  include  lib64  NVIDIA_CUDA-10.1_Samples  NVIDIA_CUDA-9.0_Samples  src
  1. 我通过更改.bashrc文件中这三行来决定我启用哪个版本的CUDA(我没有使用软连接,而是直接指向了真实的目录位置;如果使用软连接则需要更改软连接来实现:查看这条博客)

#我的.bashrc的更改之前的关键三行:
#把cuda-9.0改成cuda-10.0,然后source一下.bashrc文件,将终端关闭重新打开,再查看nvcc版本,就变成了10.0

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hongze/cudas/cuda-9.0/lib64
export PATH=$PATH:/home/hongze/cudas/cuda-9.0/bin
export CUDA_HOME=$CUDA_HOME:/home/hongze/cudas/cuda-9.0

1.2 编译出错的具体情况

1.2.1 编译make.sh前必要的修改

  • 基本上make.sh编译前需要检查CUDA_ARCH是否与你的显卡适配:详情看这个博客或者nvidia官网的信息;
  • 如果你的CUDA的软连接无效了或者像我一样不使用软链接,则需要修改CUDA_PATH;
#make.sh文件的内容
#!/usr/bin/env bash

#CUDA_PATH=/usr/local/cuda/
CUDA_PATH=/home/hongze/cudas/cuda9#我修改了我的CUDA_PATH

export CXXFLAGS="-std=c++11"
export CFLAGS="-std=c99"

python3 setup.py build_ext --inplace
rm -rf build

# Choose cuda arch as you need
CUDA_ARCH="-gencode arch=compute_30,code=sm_30 \
           -gencode arch=compute_35,code=sm_35 \
           -gencode arch=compute_50,code=sm_50 \
           -gencode arch=compute_52,code=sm_52 \
           -gencode arch=compute_60,code=sm_60 \
           -gencode arch=compute_61,code=sm_61 \
           -gencode arch=compute_70,code=sm_70 "#我使用的显卡是TITAN XP

# compile NMS
cd model/nms/src
echo "Compiling nms kernels by nvcc..."
nvcc -c -o nms_cuda_kernel.cu.o nms_cuda_kernel.cu \
	 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH

cd ../
python3 build.py

# compile roi_pooling
cd ../../
cd model/roi_pooling/src
echo "Compiling roi pooling kernels by nvcc..."
nvcc -c -o roi_pooling.cu.o roi_pooling_kernel.cu \
	 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
cd ../
python3 build.py

# # compile roi_align
# cd ../../
# cd model/roi_align/src
# echo "Compiling roi align kernels by nvcc..."
# nvcc -c -o roi_align_kernel.cu.o roi_align_kernel.cu \
# 	 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
# cd ../
# python3 build.p

# compile roi_crop
cd ../../
cd model/roi_crop/src
echo "Compiling roi crop kernels by nvcc..."
nvcc -c -o roi_crop_cuda_kernel.cu.o roi_crop_cuda_kernel.cu \
	 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
cd ../
python3 build.py

# compile roi_align (based on Caffe2's implementation)
cd ../../
cd modeling/roi_xfrom/roi_align/src
echo "Compiling roi align kernels by nvcc..."
nvcc -c -o roi_align_kernel.cu.o roi_align_kernel.cu \
	 -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
cd ../
python3 build.py

1.2.2 报错信息

fatal error: cuda.h: No such file or directory一共出现4次,分别是编译NMS、roi_pooling、roi_crop、roi_align四个部分产生的

#执行sh make.sh的报错信息
(FSOD) hongze@lab-PowerEdge-T630 ~/Documents/FSOD-code/lib$ sh make.sh
running build_ext
building 'utils.cython_bbox' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/utils
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/numpy/core/include -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c utils/cython_bbox.c -o build/temp.linux-x86_64-3.6/utils/cython_bbox.o -Wno-cpp
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/utils
c99 build/temp.linux-x86_64-3.6/utils/cython_bbox.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/utils/cython_bbox.cpython-36m-x86_64-linux-gnu.so
building 'utils.cython_nms' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/numpy/core/include -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c utils/cython_nms.c -o build/temp.linux-x86_64-3.6/utils/cython_nms.o -Wno-cpp
gcc -pthread -shared -L/home/hongze/anaconda3/envs/FSOD/lib -Wl,-rpath=/home/hongze/anaconda3/envs/FSOD/lib,--no-as-needed -std=c99 build/temp.linux-x86_64-3.6/utils/cython_nms.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/utils/cython_nms.cpython-36m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.6/utils/cython_bbox.cpython-36m-x86_64-linux-gnu.so -> utils
copying build/lib.linux-x86_64-3.6/utils/cython_nms.cpython-36m-x86_64-linux-gnu.so -> utils
Compiling nms kernels by nvcc...
Including CUDA code.
/home/hongze/Documents/FSOD-code/lib/model/nms
['/home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda_kernel.cu.o']
generating /tmp/tmp5qy32gtx/_nms.c
setting the current directory to '/tmp/tmp5qy32gtx'
running build_ext
building '_nms' extension
creating home
creating home/hongze
creating home/hongze/Documents
creating home/hongze/Documents/FSOD-code
creating home/hongze/Documents/FSOD-code/lib
creating home/hongze/Documents/FSOD-code/lib/model
creating home/hongze/Documents/FSOD-code/lib/model/nms
creating home/hongze/Documents/FSOD-code/lib/model/nms/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c _nms.c -o ./_nms.o -std=c99
In file included from /home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
                 from _nms.c:570:
/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
    extra_postargs)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "build.py", line 37, in <module>
    ffi.build()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/api.py", line 727, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/recompiler.py", line 1555, in recompile
    compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling roi pooling kernels by nvcc...
Including CUDA code.
/home/hongze/Documents/FSOD-code/lib/model/roi_pooling
generating /tmp/tmpuhxsnvnf/_roi_pooling.c
setting the current directory to '/tmp/tmpuhxsnvnf'
running build_ext
building '_roi_pooling' extension
creating home
creating home/hongze
creating home/hongze/Documents
creating home/hongze/Documents/FSOD-code
creating home/hongze/Documents/FSOD-code/lib
creating home/hongze/Documents/FSOD-code/lib/model
creating home/hongze/Documents/FSOD-code/lib/model/roi_pooling
creating home/hongze/Documents/FSOD-code/lib/model/roi_pooling/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c _roi_pooling.c -o ./_roi_pooling.o -std=c99
In file included from /home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
                 from _roi_pooling.c:570:
/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
    extra_postargs)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "build.py", line 35, in <module>
    ffi.build()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/api.py", line 727, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/recompiler.py", line 1555, in recompile
    compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling roi crop kernels by nvcc...
Including CUDA code.
/home/hongze/Documents/FSOD-code/lib/model/roi_crop
generating /tmp/tmp3j3suxnv/_roi_crop.c
setting the current directory to '/tmp/tmp3j3suxnv'
running build_ext
building '_roi_crop' extension
creating home
creating home/hongze
creating home/hongze/Documents
creating home/hongze/Documents/FSOD-code
creating home/hongze/Documents/FSOD-code/lib
creating home/hongze/Documents/FSOD-code/lib/model
creating home/hongze/Documents/FSOD-code/lib/model/roi_crop
creating home/hongze/Documents/FSOD-code/lib/model/roi_crop/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c _roi_crop.c -o ./_roi_crop.o -std=c99
In file included from /home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
                 from _roi_crop.c:570:
/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
    extra_postargs)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "build.py", line 36, in <module>
    ffi.build()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/api.py", line 727, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/recompiler.py", line 1555, in recompile
    compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling roi align kernels by nvcc...
Including CUDA code.
/home/hongze/Documents/FSOD-code/lib/modeling/roi_xfrom/roi_align
generating /tmp/tmpfskoao8a/_roi_align.c
setting the current directory to '/tmp/tmpfskoao8a'
running build_ext
building '_roi_align' extension
creating home
creating home/hongze
creating home/hongze/Documents
creating home/hongze/Documents/FSOD-code
creating home/hongze/Documents/FSOD-code/lib
creating home/hongze/Documents/FSOD-code/lib/modeling
creating home/hongze/Documents/FSOD-code/lib/modeling/roi_xfrom
creating home/hongze/Documents/FSOD-code/lib/modeling/roi_xfrom/roi_align
creating home/hongze/Documents/FSOD-code/lib/modeling/roi_xfrom/roi_align/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c _roi_align.c -o ./_roi_align.o -std=c99
In file included from /home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
                 from _roi_align.c:570:
/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
    extra_postargs)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
    dist.run_command('build_ext')
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "build.py", line 36, in <module>
    ffi.build()
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 189, in build
    _build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 111, in _build_extension
    outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/api.py", line 727, in compile
    compiler_verbose=verbose, debug=debug, **kwds)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/recompiler.py", line 1555, in recompile
    compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
    outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
  File "/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command 'gcc' failed with exit status 1

2.解决方法

主要要修改的有两个地方:make.sh文件的内容、执行make.sh的命令

2.1 我的解决方法

参考了这条回答:看原出处

Hi all, if you encounter this error on compling fatal error: cuda.h: No such file or directory
Try this:
CPATH=/path/to/you/cuda/include ./make.sh

于是我编译时输入的命令由:sh make.sh改为CPATH=/home/hongze/cudas/cuda9/include/ ./make.sh,编译成功

#编译成功的结果
(FSOD) hongze@lab-PowerEdge-T630 ~/Documents/FSOD-code/lib$ CPATH=/home/hongze/cudas/cuda9/include/ ./make.sh
running build_ext
building 'utils.cython_bbox' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/utils
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/numpy/core/include -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c utils/cython_bbox.c -o build/temp.linux-x86_64-3.6/utils/cython_bbox.o -Wno-cpp
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/utils
gcc -pthread -shared -L/home/hongze/anaconda3/envs/FSOD/lib -Wl,-rpath=/home/hongze/anaconda3/envs/FSOD/lib,--no-as-needed build/temp.linux-x86_64-3.6/utils/cython_bbox.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/utils/cython_bbox.cpython-36m-x86_64-linux-gnu.so
building 'utils.cython_nms' extension
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/numpy/core/include -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c utils/cython_nms.c -o build/temp.linux-x86_64-3.6/utils/cython_nms.o -Wno-cpp
utils/cython_nms.c: In function ‘__pyx_pf_5utils_10cython_nms_2soft_nms’:
utils/cython_nms.c:3399:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       __pyx_t_10 = ((__pyx_v_pos < __pyx_v_N) != 0);
                                  ^
utils/cython_nms.c:3910:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       __pyx_t_10 = ((__pyx_v_pos < __pyx_v_N) != 0);
                                  ^
gcc -pthread -shared -L/home/hongze/anaconda3/envs/FSOD/lib -Wl,-rpath=/home/hongze/anaconda3/envs/FSOD/lib,--no-as-needed build/temp.linux-x86_64-3.6/utils/cython_nms.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/utils/cython_nms.cpython-36m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.6/utils/cython_bbox.cpython-36m-x86_64-linux-gnu.so -> utils
copying build/lib.linux-x86_64-3.6/utils/cython_nms.cpython-36m-x86_64-linux-gnu.so -> utils
running build_ext
building 'utils.cython_bbox' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/utils
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/numpy/core/include -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c utils/cython_bbox.c -o build/temp.linux-x86_64-3.6/utils/cython_bbox.o -Wno-cpp
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/utils
gcc -pthread -shared -L/home/hongze/anaconda3/envs/FSOD/lib -Wl,-rpath=/home/hongze/anaconda3/envs/FSOD/lib,--no-as-needed -std=c99 build/temp.linux-x86_64-3.6/utils/cython_bbox.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/utils/cython_bbox.cpython-36m-x86_64-linux-gnu.so
building 'utils.cython_nms' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/numpy/core/include -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c utils/cython_nms.c -o build/temp.linux-x86_64-3.6/utils/cython_nms.o -Wno-cpp
gcc -pthread -shared -L/home/hongze/anaconda3/envs/FSOD/lib -Wl,-rpath=/home/hongze/anaconda3/envs/FSOD/lib,--no-as-needed -std=c99 build/temp.linux-x86_64-3.6/utils/cython_nms.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/utils/cython_nms.cpython-36m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.6/utils/cython_bbox.cpython-36m-x86_64-linux-gnu.so -> utils
copying build/lib.linux-x86_64-3.6/utils/cython_nms.cpython-36m-x86_64-linux-gnu.so -> utils
Compiling nms kernels by nvcc...
Including CUDA code.
/home/hongze/Documents/FSOD-code/lib/model/nms
['/home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda_kernel.cu.o']
generating /tmp/tmpw5rm8jqh/_nms.c
setting the current directory to '/tmp/tmpw5rm8jqh'
running build_ext
building '_nms' extension
creating home
creating home/hongze
creating home/hongze/Documents
creating home/hongze/Documents/FSOD-code
creating home/hongze/Documents/FSOD-code/lib
creating home/hongze/Documents/FSOD-code/lib/model
creating home/hongze/Documents/FSOD-code/lib/model/nms
creating home/hongze/Documents/FSOD-code/lib/model/nms/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c _nms.c -o ./_nms.o -std=c99
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -fPIC -DWITH_CUDA -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/hongze/anaconda3/envs/FSOD/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/hongze/anaconda3/envs/FSOD/include/python3.6m -c /home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda.c -o ./home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda.o -std=c99
gcc -pthread -shared -L/home/hongze/anaconda3/envs/FSOD/lib -Wl,-rpath=/home/hongze/anaconda3/envs/FSOD/lib,--no-as-needed -std=c99 ./_nms.o ./home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda.o /home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda_kernel.cu.o -L/home/hongze/anaconda3/envs/FSOD/lib -lpython3.6m -o ./_nms.so

☆另外,我解决了cuda.h找不到的问题后出现另一个问题:nms_cuda.c: No such file or directory

gcc: error: /home/hongze/Documents/FSOD-code/lib/model/nms/src/nms_cuda.c: No such file or directory

只需要在FSOD-code/lib/model/nms/src/自行加入该文件,点击查看nms_cuda.c文件内容:

This aims to fix issue #17. The compling error is actually caused by missing the file nms_cuda.c. I borrow the one in Detectron.pytorch.

  • 强制使用指定位置的nvcc:https://github.com/jwyang/faster-rcnn.pytorch/issues/55
  • 在make.sh文件前面添加这三行:
#export PATH=home/hongze/cudas/cuda-9.0/bin${PATH:+:${PATH}}
#export CPATH=home/hongze/cudas/cuda-9.0/include${CPATH:+:${CPATH}}
#export LD_LIBRARY_PATH=home/hongze/cudas/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • 自行创建软连接连接到cuda.h的:

For me, I don’t have root access. I can’t make such symlinks to the system. So I just symlinked to the problem dir and it works now. Not recommending this, just for those in a similar situation to me with whom no environmental variable setting has helped.

ln -s ~/cuda/include/* ~/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/
  • 有人重新安装了pytorch0.4.0,然后解决了问题

Hi @huinsysu, do you solve the issue, I met the same error as yours. And I reinstall the pytorch0.4.0, then solve the issue.

  • 有人在make.h中指定了CUDA_ARCH的值:

Hope this is not too late. Actually all the solutions mentioned above does not work for me. I solved this by modifying the file ‘~/lib/make.sh’. In the file, please comment the CUDA_ARCH line and changed the ‘$CUDA_ARCH’ in each compilation into ‘-arch=arch’
Taking the nms package as an example, the previous command (line 20)is:
nvcc -c -o nms_cuda_kernel.cu.o nms_cuda_kernel.cu
-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CUDA_ARCH
Now, we should change it as:
nvcc -c -o nms_cuda_kernel.cu.o nms_cuda_kernel.cu
-D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52
Then conduct similar operations for other packages.
It should be noted that ‘arch’ is determined by your GPU type.-arch=sm_52’ works for TitanX. You could look at the Compilation Section in this Page or the documents of the NVCC for information of your GPU.
I am still a bit confused about the problem. I guess it results from the CUDA version.

  • 更多解决方法请查看:
    论文作者的指路,包含了4个Issue页面,点击查看:

You can reference here to find solutions: detectron-tw, stan-dev470, stan-dev622, stan-dev561

2.2 总结

知其然,却不知其所以然。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

解决......lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory报错问题 的相关文章

  • PHP file_get_contents 与 php 完好无损吗?

    与使用 include 不同 include 执行文件中包含的 php 是否可以将 php 文件的内容保存到变量中 但 php 仍然完整且可执行 我的目标看起来像这样 template some imaginary include func
  • 多个定义和仅标头库

    我有一个带有几个 c 和 h 文件的 C 程序 我决定将程序的一部分设为 仅标头 因此我将代码从 c 移至 h 现在我遇到了多重定义问题 但我不知道为什么 例如 main c includes utils h vector c includ
  • 如何在 Visual Studio 中包含子目录?

    我必须包含许多头文件 它们位于不同的子目录中 Visual Studio 中是否有一种方法 我使用的是 2005 版 来设置一个包含路径 Visual Studio 也会在子目录中搜索头文件 从设计的角度来看 在 Visual Studio
  • 如何避免包含类实现文件?

    而不是做 include MyClass cpp 我想要做 include MyClass h 我在网上读到过not这样做被认为是不好的做法 简而言之单独编译 首先 让我们举一些简单的例子 struct ClassDeclaration c
  • C++ 中使用 #include 和 #include 的区别

    使用有什么区别 include
  • 为什么 Mac 上的 clang 会自动包含一些缺失的标头?

    我注意到clang 包括缺少的标头
  • R 加载错误 - libproj.so.13:无法打开共享对象文件:没有这样的文件或目录

    我正在尝试安装 CRANs 群体遗传学包希尔夫统计 https cran r project org web packages hierfstat hierfstat pdf 但是 libproj so 13 打印出以下错误 gt inst
  • C++ 中的名称冲突

    在编写一些代码时我遇到了这个问题 include
  • 为什么 gets() 被弃用? [复制]

    这个问题在这里已经有答案了 使用时gets 在我的代码中 编译器大喊 warning the gets function is dangerous and should not be used and warning gets is dep
  • 如何将参数传递给使用“include”呈现的PHP模板?

    需要 PHP 模板方面的帮助 我是 PHP 新手 我来自 Perl Embperl 无论如何 我的问题很简单 我有一个小模板来渲染一些项目 让它成为一篇博客文章 我知道使用此模板的唯一方法是使用 include 指令 我想在遍历所有相关博客
  • 使用 Linq + Include 排序

    我与两个实体有一对多关系 Order int OrderId string OrderNumber OrderItem int ItemId int sequence Product int ProductId string Product
  • PHP 包含最佳实践问题

    我一直在学习 PHP 语法并进行练习 我有 NET 背景 因此母版页总是让我在处理页眉和页脚时变得非常简单 到目前为止 我有一个 mainHeader php 和 mainFooter php 其中有我的头部菜单和页脚 html 我创建了一
  • 如何在项目中实现预编译头

    我了解预编译头背后的目的和推理 然而 实施时有哪些规则呢 根据我的理解 事情是这样的 将您的项目设置为使用带有 YU 指令的预编译头 创建 stdafx h 文件并将其设置为预编译头 将此作为每个 h 文件中的顶部包含语句 这是正确的吗 您
  • 如何使用QtCopyDialog?

    我包括这个库 include
  • 实体框架 - 包含在子查询中? - 第2部分

    我不确定这是否是正确的做法 我确信有人会告诉我是否正确 我问了一个问题 实体框架 包含在子查询中 https stackoverflow com questions 1662760 entity framework include in s
  • 如何将 php 文件包含在主域的子域中

    我的服务器中有两个文件夹 MainDomain header php index php footer php Subdomain index php 现在我想包括header php来自主域index php这是在子域中 通过使用incl
  • PHP 解析包含

    我包括一个文件init php它定义路径常量 所以如果我包括init php在一个文件中 索引 php 然后在另一个文件中 布局 header php is init php在添加到这些文件之前进行解析 还是添加到父文件中 然后将父文件作为
  • 如何在 Jinja2 中包含具有相对路径的模板

    我正在尝试在模板中包含同一文件夹中的另一个模板 为此 我只是在做 import header jinja2 问题是我不断收到TemplateNotFound error 我的模板文件夹看起来像 myProject templates arb
  • Qt 的最佳实践包括和预编译头文件?

    当使用现代和最新的 C 编译器 例如 MSVC2015 并激活预编译头时 当前关于包含 Qt 头文件的 最佳实践 是什么 Example include
  • 如何使用 GCC 在 C 上编译库?

    我用这些文件创建了一个库pila h and pila c 我编译文件pila c with gcc pila c c这个库运行良好 我已经测试过了 然后我又做了一个图书馆 这个库有文件pila funciones extra h and

随机推荐

  • DeepFool对抗算法_学习笔记

    前言 本篇博客出于学习交流目的 xff0c 主要是用来记录自己学习中遇到的问题和心路历程 xff0c 方便之后回顾 过程中可能引用其他大牛的博客 xff0c 文末会给出相应链接 xff0c 侵删 xff01 DeepFool算法 特点 xf
  • 对抗样本黑箱攻击UPSET、ANGRI_学习笔记

    前言 本篇博客出于学习交流目的 xff0c 主要是用来记录自己学习中遇到的问题和心路历程 xff0c 方便之后回顾 过程中可能引用其他大牛的博客 xff0c 文末会给出相应链接 xff0c 侵删 xff01 DeepFool算法 特点 xf
  • One pixel 对抗攻击_学习笔记

    前言 本篇博客出于学习交流目的 xff0c 主要是用来记录自己学习中遇到的问题和心路历程 xff0c 方便之后回顾 过程中可能引用其他大牛的博客 xff0c 文末会给出相应链接 xff0c 侵删 xff01 One pixel 对抗攻击算法
  • 对抗样本可转移性与黑盒攻击_学习笔记

    前言 本篇博客出于学习交流目的 xff0c 主要是用来记录自己学习中遇到的问题和心路历程 xff0c 方便之后回顾 过程中可能引用其他大牛的博客 xff0c 文末会给出相应链接 xff0c 侵删 xff01 对抗样本可转移性与黑盒攻击深入研
  • VNC安装记录

    又是一次痛苦的安装过程 xff0c 记录一下避免再次踩坑 sudo apt get install tightvncserver 我安装的是tightvncserver 这个版本 xff0c 网上也有很多是vnc4server xff0c
  • ubuntu升级python版本

    Ubuntu16 04默认安装了Python2 7和3 5 请注意 xff0c 系统自带的python千万不能卸载 xff01 输入命令python 按Ctrl 43 D退出python命令行 输入命令sudo add apt reposi
  • Python microseconds 显示问题,及毫秒显示方法

    系统环境Ubuntu14 04 Python3 5 问题由来 xff1a 优化程序函数运行时间 xff0c 由于输入数据量比较大 xff0c 所以恰好且与1秒左右 xff0c 之前数据量小的数据集测试时用微秒 xff08 microseco
  • 关于ssh: connect to host XXX port 22: Connection timed out的解决办法

    今天想试着建立一个ss xff0c 结果犯了很多人在这里都会出现的错误 xff0c SSH连接不上 下面展现了笔者解决这个问题的流程 一 xff1a 查看master和data1 3的IP地址 当直接对data1 data2 data3进行
  • Matlab 应用GPU加速

    由于GPU近几年地迅速发展 xff0c GPU在多线程计算等方面逐渐超越CPU成为计算的主力军 而Matlab是常用的数学应用软件 xff0c 现在讲解一下如何在Matlab中使用GPU加速计算 文章目录 0 必要条件1 给GPU传输数据1
  • crt + xManager 远程打开linux 图形界面

    因为想要使用eclipse所以看了一下如何远程显示图形界面 1 安装eclipse c 43 43 xff1a sudo apt get install eclipse sudo apt get install eclipse cdt 2
  • keras.layers.upsampling2d

    span class token keyword from span keras span class token punctuation span layers span class token keyword import span U
  • (二)MapReduce整体流程

    1 MapReduce工作流程 1 MapReduce核心思想 图6 xff1a 采用 分而治之 思想 xff0c 将大数据集拆分到多个小数据块 xff0c 再转到多台机器上并行处理 总的来说Map任务独立执行被分割的数据 xff0c Re
  • 在 Linux 系统下使用badblocks检测硬盘上的坏道和坏块

    让我们从坏道和坏块的定义开始说起 xff0c 它们是一块磁盘或闪存上不再能够被读写的部分 xff0c 一般是由于磁盘表面特定的物理损坏或闪存晶体管失效导致的 随着坏道的继续积累 xff0c 它们会对你的磁盘或闪存容量产生令人不快或破坏性的影
  • 【已解决】NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver 的报错

    问题描述 基于ubuntu16 04 xff0c 本人在更换一次系统下载源后 xff0c 误操作进行了内核升级 执行以下查看cuda命令 xff1a nvidia smi 出现如下提示 xff1a NVIDIA SMI has failed
  • python在图片上画矩形

    python在图片上画矩形 image path 61 39 39 image 61 cv2 imread image path first point 61 100 100 last point 61 100 100 cv2 rectan
  • Java中的线程池(3)----SingleThreadExecutor

    本文简单介绍Java中的另一种线程池 SingleThreadExecutor 创建SingleThreadExecutor的静态方法 首先还是先看一下创建SingleThreadExecutor的Executors下的静态方法 xff1a
  • ros运行catkin_make报警:No module named em......

    ros运行catkin make报警 xff1a No module named em 问题描述我的解决方法待续参考链接 问题描述 在跟着ros教程学习 创建ros消息和ros服务 http wiki ros org cn ROS Tuto
  • 2019论文阅读:SIMCO: SIMILARITY-BASED OBJECT COUNTING

    发表于CVPR2019 文章目录 文章贡献1 绪论2 SIMCO的两个阶段2 1 SIMCO detectionInShape数据集网络结构 xff1a 2 2 SIMCO clustering 3 实验及结果4 总结 文章贡献 提出了SI
  • 2020论文阅读:Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector

    文章目录 文章贡献1 绪论2 有关研究2 1 General Object Detection2 2 Few shot learning 3 FSOD A Highly Diverse Few Shot Object Detection D
  • 解决......lib/include/THC/THCGeneral.h:12:18: fatal error: cuda.h: No such file or directory报错问题

    文章目录 1 问题描述1 1 构建的环境 xff1a 完全按照要求1 2 编译出错的具体情况1 2 1 编译make sh前必要的修改1 2 2 报错信息 2 解决方法2 1 我的解决方法2 xff12 总结 1 问题描述 本人在编译Few