ZhouYanzhao / ORN

Oriented Response Networks, in CVPR 2017
http://yzhou.work/ORN
BSD 3-Clause "New" or "Revised" License
223 stars 51 forks source link

Trouble installing pytorch-v2 branch #22

Open rsousa95 opened 1 year ago

rsousa95 commented 1 year ago

I'm having some trouble installing the pytorch-v2 branch.

I've created a new conda environment and installed pytorch 1.12.0 with the command from here: conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6 -c pytorch -c conda-forge

Then I cloned this repository with git clone --single-branch --branch pytorch-v2 https://github.com/ZhouYanzhao/ORN

Then I follow the instructions with the following and get: cd ORN pip install .

Processing /home/inno/devel/object-detection/ORN
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: orn
  Building wheel for orn (setup.py) ... done
  Created wheel for orn: filename=orn-1.0.0-py3-none-any.whl size=10661 sha256=b160fda674b97330dc00d5fd1d429513cb3b52f5b4697b63f8e6935329ab284a
  Stored in directory: /tmp/pip-ephem-wheel-cache-v4f25yce/wheels/1a/89/cd/c894f8cb9255d7ae6ca139b0e35bc59952eaa14c4bbb0b7195
Successfully built orn
Installing collected packages: orn
  Attempting uninstall: orn
    Found existing installation: orn 1.0.0
    Uninstalling orn-1.0.0:
      Successfully uninstalled orn-1.0.0
Successfully installed orn-1.0.0

Then when executing a python script I do import orn and get:

Using ~/.cache/torch_extensions/py37_cu116 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file ~/.cache/torch_extensions/py37_cu116/active_rotating_filters/build.ninja...
Building extension module active_rotating_filters...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] /usr/bin/nvcc  -DTORCH_EXTENSION_NAME=active_rotating_filters -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1013\" -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include/TH -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include/THC -isystem /opt/anaconda3/envs/CHPDet/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/orn/lib/active_rotating_filters.cu -o active_rotating_filters.cuda.o
FAILED: active_rotating_filters.cuda.o
/usr/bin/nvcc  -DTORCH_EXTENSION_NAME=active_rotating_filters -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1013\" -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include/TH -isystem /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/include/THC -isystem /opt/anaconda3/envs/CHPDet/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -c /opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/orn/lib/active_rotating_filters.cu -o active_rotating_filters.cuda.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1814, in _run_ninja_build
    env=env)
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/orn/__init__.py", line 1, in <module>
    from orn.oriented_response_convolution import ORConv2d
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/orn/oriented_response_convolution.py", line 8, in <module>
    from orn.active_rotating_filters import mapping_rotate
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/orn/active_rotating_filters.py", line 10, in <module>
    ]], verbose=True)
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1214, in load
    keep_intermediates=keep_intermediates)
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1435, in _jit_compile
    is_standalone=is_standalone)
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1540, in _write_ninja_file_and_build_library
    error_prefix=f"Error building extension '{name}'")
  File "/opt/anaconda3/envs/CHPDet/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1824, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error building extension 'active_rotating_filters'

Any idea on how to fix this?

15689933561 commented 1 year ago

image 我也是,之前可以用,今天突然啥也加载不出来了,卡在这里