โ06-04-2023 06:30 PM
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
โ06-05-2023 12:44 AM
Hi, The issue can be with dependency package installation, which is CUDA here (most probably).
Also, could you please get the logs for full command output?
Also, please tag @Debayanโ with your next response which will notify me, Thank you!
โ06-09-2023 09:48 AM
@Debayan Mukherjeeโ Unfortunately your links did not help. Kind of scratching my head at this point.
โ06-13-2023 07:51 AM
@Joshua Robergeโ :
The error message suggests that the installation of Detectron2 failed due to a missing file (cusparse.h) related to CUDA. To resolve this issue, you can try the following steps:
!pip install torch --upgrade
Finally, Retry Detectron2 Installation: After verifying the CUDA installation and updating PyTorch, attempt to reinstall Detectron2 using the pip command you provided:
โ06-09-2023 05:06 AM
Hi @Joshua Robergeโ,
We haven't heard from you since the last response from @Debayan Mukherjeeโโ, and I was checking back to see if you were able to resolve your issue and would you be happy to share the solution, as it can be helpful to others.
Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.
โ06-09-2023 09:38 AM
Unfortunately his solution did not work out. Are there any other suggestions? I'm still getting build issues
โ06-14-2023 11:28 PM
I think the issue is with the 3rd party package Detectron 2. Do you have issues installing other packages?
โ06-14-2023 11:16 PM
Hi @Joshua Robergeโ
Sorry for the inconvenience!
Kindly review the solution offered by @Suteja Kanuri.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group