pytorch_solov2 icon indicating copy to clipboard operation
pytorch_solov2 copied to clipboard

Installation failing

Open sparshgarg23 opened this issue 3 years ago • 3 comments

When running

python setup.py develop on colab

Ran into the following error

running develop
running egg_info
creating focalloss.egg-info
writing focalloss.egg-info/PKG-INFO
writing dependency_links to focalloss.egg-info/dependency_links.txt
writing top-level names to focalloss.egg-info/top_level.txt
writing manifest file 'focalloss.egg-info/SOURCES.txt'
/usr/local/lib/python3.7/dist-packages/torch/utils/cpp_extension.py:387: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
writing manifest file 'focalloss.egg-info/SOURCES.txt'
running build_ext
/usr/local/lib/python3.7/dist-packages/torch/utils/cpp_extension.py:788: UserWarning: The detected CUDA version (11.1) has a minor version mismatch with the version that was used to compile PyTorch (11.3). Most likely this shouldn't be a problem.
  warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
building 'modules.sigmoid_focal_loss.sigmoid_focal_loss_cuda' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/modules
creating build/temp.linux-x86_64-3.7/modules/sigmoid_focal_loss
creating build/temp.linux-x86_64-3.7/modules/sigmoid_focal_loss/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/usr/local/lib/python3.7/dist-packages/torch/include -I/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.7/dist-packages/torch/include/TH -I/usr/local/lib/python3.7/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.7m -c modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp -o build/temp.linux-x86_64-3.7/modules/sigmoid_focal_loss/src/sigmoid_focal_loss.o -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=sigmoid_focal_loss_cuda -D_GLIBCXX_USE_CXX11_ABI=0
modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp: In function ‘at::Tensor SigmoidFocalLoss_forward(const at::Tensor&, const at::Tensor&, int, float, float)’:
modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp:21:19: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
   if (logits.type().is_cuda()) {
                   ^
In file included from /usr/local/lib/python3.7/dist-packages/torch/include/ATen/core/Tensor.h:3:0,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/ATen/DeviceGuard.h:4,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/ATen/ATen.h:11,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/extension.h:4,
                 from modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp:3:
/usr/local/lib/python3.7/dist-packages/torch/include/ATen/core/TensorBody.h:210:30: note: declared here
   DeprecatedTypeProperties & type() const {
                              ^~~~
modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp: In function ‘at::Tensor SigmoidFocalLoss_backward(const at::Tensor&, const at::Tensor&, const at::Tensor&, int, float, float)’:
modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp:33:19: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
   if (logits.type().is_cuda()) {
                   ^
In file included from /usr/local/lib/python3.7/dist-packages/torch/include/ATen/core/Tensor.h:3:0,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/ATen/DeviceGuard.h:4,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/ATen/ATen.h:11,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /usr/local/lib/python3.7/dist-packages/torch/include/torch/extension.h:4,
                 from modules/sigmoid_focal_loss/src/sigmoid_focal_loss.cpp:3:
/usr/local/lib/python3.7/dist-packages/torch/include/ATen/core/TensorBody.h:210:30: note: declared here
   DeprecatedTypeProperties & type() const {
                              ^~~~
/usr/local/cuda/bin/nvcc -DWITH_CUDA -I/usr/local/lib/python3.7/dist-packages/torch/include -I/usr/local/lib/python3.7/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.7/dist-packages/torch/include/TH -I/usr/local/lib/python3.7/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.7m -c modules/sigmoid_focal_loss/src/sigmoid_focal_loss_cuda.cu -o build/temp.linux-x86_64-3.7/modules/sigmoid_focal_loss/src/sigmoid_focal_loss_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=sigmoid_focal_loss_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14
modules/sigmoid_focal_loss/src/sigmoid_focal_loss_cuda.cu:12:10: fatal error: THC/THC.h: No such file or directory
 #include <THC/THC.h>
          ^~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

After looking into it ,it seems that it's a mismatch between pytorch version my pytorch and cuda version is

1.11.0+cu113

sparshgarg23 avatar May 07 '22 08:05 sparshgarg23

this repo use old pytorch version. not test on newer pytorch version. maybe it not work. now i haven't much time to maintain this repo. sorry, maye use other repo is abetter choice.

ABlueLight avatar May 10 '22 03:05 ABlueLight

Is there any other repo that uses the newer versions of pytorch? I need the segmentation mask and class output, which is why I decided to use your repo. I am taking this output and using it for a panoptic model that is running on latest pytorch. So I need both in the same torch version.

williamcfrancis avatar Dec 13 '22 21:12 williamcfrancis