LoginSignup
0
0

yolov5-obb インストール時のエラー「~ 'THC/THC.h': No such file or directory ~ 」の対処方法

Last updated at Posted at 2024-01-17

yolov5-obbインストール時、utils/nms_rotatedのセットアップを実施した際に以下のようなエラーが発生.

/usr/local/cuda/bin/nvcc -DWITH_CUDA -I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.10 -c src/poly_nms_cuda.cu -o build/temp.linux-x86_64-cpython-310/src/poly_nms_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' -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=nms_rotated_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++17
src/poly_nms_cuda.cu:4:10: fatal error: THC/THC.h: No such file or directory
    4 | #include <THC/THC.h>
      |          ^~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1

image.png

nms_rotatedのコードが最新のcuda(今回試したのは,cuda_12.2)に対応していないらしい.
下記issueで最新バージョンのcudaに対応しているnms_rotatedをアップしてくれている方がいた.

エラー対策後のnms_rotatedのリンクはこちら

これを元のyolov5/utils/nms_rotatedと入れ替えると上記エラーの対処ができる.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0