Detectron2 install

Westinghouse
New Contributor II

I have been struggling to install Detectron 2. I think it is an issue with Cuda. Any adivise?

install

!pip install -q "detectron2@git+https://github.com/facebookresearch/detectron2.git@e2ce8dc#egg=detectron2"

Error:

qm8vsdal/detectron2_85faeed5ce7945dbad35d6c918b88b44/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_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 -std=c++17

In file included from /tmp/pip-install-qm8vsdal/detectron2_85faeed5ce7945dbad35d6c918b88b44/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.cu:3:

/local_disk0/.ephemeral_nfs/envs/pythonEnv-e16d1c93-889b-4c84-bb01-f482f62b47b7/lib/python3.9/site-packages/torch/include/ATen/cuda/CUDAContext.h:6:10: fatal error: cusparse.h: No such file or directory

6 | #include <cusparse.h>

| ^~~~~~~~~~~~

compilation terminated.

error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1

----------------------------------------

ERROR: Command errored out with exit status 1: /local_disk0/.ephemeral_nfs/envs/pythonEnv-e16d1c93-889b-4c84-bb01-f482f62b47b7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qm8vsdal/detectron2_85faeed5ce7945dbad35d6c918b88b44/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qm8vsdal/detectron2_85faeed5ce7945dbad35d6c918b88b44/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1rmjnwqw/install-record.txt --single-version-externally-managed --compile --install-headers /local_disk0/.ephemeral_nfs/envs/pythonEnv-e16d1c93-889b-4c84-bb01-f482f62b47b7/include/site/python3.9/detectron2 Check the logs for full command output.

WARNING: You are using pip version 21.2.4; however, version 23.1.2 is available.

You should consider upgrading via the '/local_disk0/.ephemeral_nfs/envs/pythonEnv-e16d1c93-889b-4c84-bb01-f482f62b47b7/bin/python -m pip install --upgrade pip' comman