daniilidis-group / neural_renderer

A PyTorch port of the Neural 3D Mesh Renderer
Other
1.14k stars 254 forks source link

Support for cuda_11.x #106

Open pfvaldez opened 3 years ago

pfvaldez commented 3 years ago

Hello

Thank you for your work. I tried installing it on my machine with RTX-30 but it fails I already applied changes:

I get this error

$ pip install neural_renderer_pytorch
Collecting neural_renderer_pytorch
  Using cached neural_renderer_pytorch-1.1.3.tar.gz (19 kB)
Requirement already satisfied: torch in ./venv/lib/python3.8/site-packages (from neural_renderer_pytorch) (1.8.1+cu111)
Requirement already satisfied: numpy in ./venv/lib/python3.8/site-packages (from neural_renderer_pytorch) (1.20.2)
Requirement already satisfied: scikit-image in ./venv/lib/python3.8/site-packages (from neural_renderer_pytorch) (0.18.1)
Requirement already satisfied: matplotlib!=3.0.0,>=2.0.0 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (3.4.1)
Requirement already satisfied: tifffile>=2019.7.26 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (2021.4.8)
Requirement already satisfied: networkx>=2.0 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (2.5.1)
Requirement already satisfied: scipy>=1.0.1 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (1.6.3)
Requirement already satisfied: PyWavelets>=1.1.1 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (1.1.1)
Requirement already satisfied: imageio>=2.3.0 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (2.9.0)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,>=4.3.0 in ./venv/lib/python3.8/site-packages (from scikit-image->neural_renderer_pytorch) (8.2.0)
Requirement already satisfied: pyparsing>=2.2.1 in ./venv/lib/python3.8/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->neural_renderer_pytorch) (2.4.7)
Requirement already satisfied: cycler>=0.10 in ./venv/lib/python3.8/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->neural_renderer_pytorch) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./venv/lib/python3.8/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->neural_renderer_pytorch) (1.3.1)
Requirement already satisfied: python-dateutil>=2.7 in ./venv/lib/python3.8/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->neural_renderer_pytorch) (2.8.1)
Requirement already satisfied: six in ./venv/lib/python3.8/site-packages (from cycler>=0.10->matplotlib!=3.0.0,>=2.0.0->scikit-image->neural_renderer_pytorch) (1.15.0)
Requirement already satisfied: decorator<5,>=4.3 in ./venv/lib/python3.8/site-packages (from networkx>=2.0->scikit-image->neural_renderer_pytorch) (4.4.2)
Requirement already satisfied: typing-extensions in ./venv/lib/python3.8/site-packages (from torch->neural_renderer_pytorch) (3.10.0.0)
Building wheels for collected packages: neural-renderer-pytorch
  Building wheel for neural-renderer-pytorch (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/pfvaldez/Development/neural_renderer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-gct4rjx2
       cwd: /tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/
  Complete output (156 lines):
  running bdist_wheel
  /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/utils/cpp_extension.py:369: 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.'))
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/__init__.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/look.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/projection.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/rasterize.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/lighting.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/load_obj.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/look_at.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/perspective.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/save_obj.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/mesh.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/vertices_to_faces.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/renderer.py -> build/lib.linux-x86_64-3.8/neural_renderer
  copying neural_renderer/get_points_from_angles.py -> build/lib.linux-x86_64-3.8/neural_renderer
  creating build/lib.linux-x86_64-3.8/neural_renderer/cuda
  copying neural_renderer/cuda/__init__.py -> build/lib.linux-x86_64-3.8/neural_renderer/cuda
  running build_ext
  building 'neural_renderer.cuda.load_textures' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/neural_renderer
  creating build/temp.linux-x86_64-3.8/neural_renderer/cuda
  gcc -pthread -B /home/pfvaldez/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/TH -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/pfvaldez/Development/neural_renderer/venv/include -I/home/pfvaldez/anaconda3/include/python3.8 -c neural_renderer/cuda/load_textures_cuda.cpp -o build/temp.linux-x86_64-3.8/neural_renderer/cuda/load_textures_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:140:0,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:13,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                   from neural_renderer/cuda/load_textures_cuda.cpp:1:
  /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ParallelOpenMP.h:83:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
   #pragma omp parallel for if ((end - begin) >= grain_size)

  neural_renderer/cuda/load_textures_cuda.cpp: In function ‘at::Tensor load_textures(at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int)’:
  neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                         ^
  neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
   #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                          ^~~~~~~~~~
  neural_renderer/cuda/load_textures_cuda.cpp:28:5: note: in expansion of macro ‘CHECK_INPUT’
       CHECK_INPUT(image);
       ^
  In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                   from neural_renderer/cuda/load_textures_cuda.cpp:1:
  /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
     DeprecatedTypeProperties & type() const {
                                ^~~~
  neural_renderer/cuda/load_textures_cuda.cpp:15:23: error: ‘AT_CHECK’ was not declared in this scope
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                         ^
  neural_renderer/cuda/load_textures_cuda.cpp:15:23: note: in definition of macro ‘CHECK_CUDA’
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                         ^~~~~~~~
  neural_renderer/cuda/load_textures_cuda.cpp:28:5: note: in expansion of macro ‘CHECK_INPUT’
       CHECK_INPUT(image);
       ^
  neural_renderer/cuda/load_textures_cuda.cpp:15:23: note: suggested alternative: ‘DCHECK’
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                         ^
  neural_renderer/cuda/load_textures_cuda.cpp:15:23: note: in definition of macro ‘CHECK_CUDA’
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                         ^~~~~~~~
  neural_renderer/cuda/load_textures_cuda.cpp:28:5: note: in expansion of macro ‘CHECK_INPUT’
       CHECK_INPUT(image);
       ^
  neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                         ^
  neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
   #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                          ^~~~~~~~~~
  neural_renderer/cuda/load_textures_cuda.cpp:29:5: note: in expansion of macro ‘CHECK_INPUT’
       CHECK_INPUT(faces);
       ^
  In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                   from neural_renderer/cuda/load_textures_cuda.cpp:1:
  /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
     DeprecatedTypeProperties & type() const {
                                ^~~~
  neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                         ^
  neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
   #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                          ^~~~~~~~~~
  neural_renderer/cuda/load_textures_cuda.cpp:30:5: note: in expansion of macro ‘CHECK_INPUT’
       CHECK_INPUT(is_update);
       ^
  In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                   from neural_renderer/cuda/load_textures_cuda.cpp:1:
  /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
     DeprecatedTypeProperties & type() const {
                                ^~~~
  neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
   #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                         ^
  neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
   #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                          ^~~~~~~~~~
  neural_renderer/cuda/load_textures_cuda.cpp:31:5: note: in expansion of macro ‘CHECK_INPUT’
       CHECK_INPUT(textures);
       ^
  In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                   from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                   from neural_renderer/cuda/load_textures_cuda.cpp:1:
  /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
     DeprecatedTypeProperties & type() const {
                                ^~~~
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for neural-renderer-pytorch
  Running setup.py clean for neural-renderer-pytorch
Failed to build neural-renderer-pytorch
Installing collected packages: neural-renderer-pytorch
    Running setup.py install for neural-renderer-pytorch ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pfvaldez/Development/neural_renderer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-un0weawt/install-record.txt --single-version-externally-managed --compile --install-headers /home/pfvaldez/Development/neural_renderer/venv/include/site/python3.8/neural-renderer-pytorch
         cwd: /tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/
    Complete output (156 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/__init__.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/look.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/projection.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/rasterize.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/lighting.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/load_obj.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/look_at.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/perspective.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/save_obj.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/mesh.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/vertices_to_faces.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/renderer.py -> build/lib.linux-x86_64-3.8/neural_renderer
    copying neural_renderer/get_points_from_angles.py -> build/lib.linux-x86_64-3.8/neural_renderer
    creating build/lib.linux-x86_64-3.8/neural_renderer/cuda
    copying neural_renderer/cuda/__init__.py -> build/lib.linux-x86_64-3.8/neural_renderer/cuda
    running build_ext
    /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/utils/cpp_extension.py:369: 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.'))
    building 'neural_renderer.cuda.load_textures' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/neural_renderer
    creating build/temp.linux-x86_64-3.8/neural_renderer/cuda
    gcc -pthread -B /home/pfvaldez/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/TH -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/pfvaldez/Development/neural_renderer/venv/include -I/home/pfvaldez/anaconda3/include/python3.8 -c neural_renderer/cuda/load_textures_cuda.cpp -o build/temp.linux-x86_64-3.8/neural_renderer/cuda/load_textures_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Parallel.h:140:0,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:13,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                     from neural_renderer/cuda/load_textures_cuda.cpp:1:
    /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ParallelOpenMP.h:83:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
     #pragma omp parallel for if ((end - begin) >= grain_size)

    neural_renderer/cuda/load_textures_cuda.cpp: In function ‘at::Tensor load_textures(at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int)’:
    neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                           ^
    neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
     #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                            ^~~~~~~~~~
    neural_renderer/cuda/load_textures_cuda.cpp:28:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(image);
         ^
    In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                     from neural_renderer/cuda/load_textures_cuda.cpp:1:
    /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
       DeprecatedTypeProperties & type() const {
                                  ^~~~
    neural_renderer/cuda/load_textures_cuda.cpp:15:23: error: ‘AT_CHECK’ was not declared in this scope
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                           ^
    neural_renderer/cuda/load_textures_cuda.cpp:15:23: note: in definition of macro ‘CHECK_CUDA’
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                           ^~~~~~~~
    neural_renderer/cuda/load_textures_cuda.cpp:28:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(image);
         ^
    neural_renderer/cuda/load_textures_cuda.cpp:15:23: note: suggested alternative: ‘DCHECK’
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                           ^
    neural_renderer/cuda/load_textures_cuda.cpp:15:23: note: in definition of macro ‘CHECK_CUDA’
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                           ^~~~~~~~
    neural_renderer/cuda/load_textures_cuda.cpp:28:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(image);
         ^
    neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                           ^
    neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
     #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                            ^~~~~~~~~~
    neural_renderer/cuda/load_textures_cuda.cpp:29:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(faces);
         ^
    In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                     from neural_renderer/cuda/load_textures_cuda.cpp:1:
    /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
       DeprecatedTypeProperties & type() const {
                                  ^~~~
    neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                           ^
    neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
     #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                            ^~~~~~~~~~
    neural_renderer/cuda/load_textures_cuda.cpp:30:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(is_update);
         ^
    In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                     from neural_renderer/cuda/load_textures_cuda.cpp:1:
    /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
       DeprecatedTypeProperties & type() const {
                                  ^~~~
    neural_renderer/cuda/load_textures_cuda.cpp:15:39: 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]
     #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
                                           ^
    neural_renderer/cuda/load_textures_cuda.cpp:17:24: note: in expansion of macro ‘CHECK_CUDA’
     #define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                            ^~~~~~~~~~
    neural_renderer/cuda/load_textures_cuda.cpp:31:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(textures);
         ^
    In file included from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3:0,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/Context.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/ATen.h:9,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                     from /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
                     from neural_renderer/cuda/load_textures_cuda.cpp:1:
    /home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
       DeprecatedTypeProperties & type() const {
                                  ^~~~
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/pfvaldez/Development/neural_renderer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_g_rrln/neural-renderer-pytorch_bbaea6c060d04977906e24a00d14017d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-un0weawt/install-record.txt --single-version-externally-managed --compile --install-headers /home/pfvaldez/Development/neural_renderer/venv/include/site/python3.8/neural-renderer-pytorch Check the logs for full command output.
lawgeorge202 commented 3 years ago

why do you use pip to install it? Just use setup.py to install.

pfvaldez commented 3 years ago

I just followed the instructions given at the main branch. Thanks for the advice, I tried the instruction at the other branch sudo python3 setup.py install

This is what happended:

$ sudo python3 setup.py install
[sudo] password for pfvaldez: 
running install
running bdist_egg
running egg_info
writing neural_renderer_pytorch.egg-info/PKG-INFO
writing dependency_links to neural_renderer_pytorch.egg-info/dependency_links.txt
writing top-level names to neural_renderer_pytorch.egg-info/top_level.txt
reading manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
writing manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'neural_renderer.cuda.load_textures' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/torch/include -I/usr/lib/python3/dist-packages/torch/include/torch/csrc/api/include -I/usr/lib/python3/dist-packages/torch/include/TH -I/usr/lib/python3/dist-packages/torch/include/THC -I/usr/include/python3.6m -c neural_renderer/cuda/load_textures_cuda.cpp -o build/temp.linux-x86_64-3.6/neural_renderer/cuda/load_textures_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11
Traceback (most recent call last):
  File "setup.py", line 40, in <module>
    cmdclass = {'build_ext': BuildExtension}
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 24, in run
    self.build()
  File "/usr/lib/python3.6/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_ext')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 78, in run
    _build_ext.run(self)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/usr/lib/python3/dist-packages/torch/utils/cpp_extension.py", line 371, in build_extensions
    build_ext.build_extensions(self)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
    _build_ext.build_extension(self, ext)
  File "/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/usr/lib/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/usr/lib/python3/dist-packages/torch/utils/cpp_extension.py", line 287, in unix_wrap_compile
    "'-fPIC'"] + cflags + _get_cuda_arch_flags(cflags)
  File "/usr/lib/python3/dist-packages/torch/utils/cpp_extension.py", line 1026, in _get_cuda_arch_flags
    raise ValueError("Unknown CUDA arch ({}) or GPU not supported".format(arch))
ValueError: Unknown CUDA arch (8.6) or GPU not supported
lawgeorge202 commented 3 years ago

Use pip to install is not support cuda11. It is for old verison. From my experience, the master branch code from https://github.com/adambielski/neural_renderer is work for cuda11. I find it from the pull request.

pfvaldez commented 3 years ago

Thanks for the advice I cloned the master branch code from https://github.com/adambielski/neural_renderer

i tried editing "/usr/lib/python3/dist-packages/torch/utils/cpp_extension.py" to include CUDA arch (8.6)

    named_arches = collections.OrderedDict([
        ('Kepler+Tesla', '3.7'),
        ('Kepler', '3.5+PTX'),
        ('Maxwell+Tegra', '5.3'),
        ('Maxwell', '5.0;5.2+PTX'),
        ('Pascal', '6.0;6.1+PTX'),
        ('Volta', '7.0+PTX'),
        ('Turing', '7.5+PTX'),
        ('Ampere', '8.0+PTX;8.6')
    ])

    supported_arches = ['3.5', '3.7', '5.0', '5.2', '5.3', '6.0', '6.1', '6.2',
                        '7.0', '7.2', '7.5', '8.0', '8.6']
    valid_arch_strings = supported_arches + [s + "+PTX" for s in supported_arches]

I get a new error O.O

$ sudo python3 setup.py install
running install
running bdist_egg
running egg_info
writing neural_renderer_pytorch.egg-info/PKG-INFO
writing dependency_links to neural_renderer_pytorch.egg-info/dependency_links.txt
writing top-level names to neural_renderer_pytorch.egg-info/top_level.txt
reading manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
writing manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'neural_renderer.cuda.load_textures' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/torch/include -I/usr/lib/python3/dist-packages/torch/include/torch/csrc/api/include -I/usr/lib/python3/dist-packages/torch/include/TH -I/usr/lib/python3/dist-packages/torch/include/THC -I/usr/include/python3.6m -c neural_renderer/cuda/load_textures_cuda.cpp -o build/temp.linux-x86_64-3.6/neural_renderer/cuda/load_textures_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11
/usr/bin/nvcc -I/usr/lib/python3/dist-packages/torch/include -I/usr/lib/python3/dist-packages/torch/include/torch/csrc/api/include -I/usr/lib/python3/dist-packages/torch/include/TH -I/usr/lib/python3/dist-packages/torch/include/THC -I/usr/include/python3.6m -c neural_renderer/cuda/load_textures_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/neural_renderer/cuda/load_textures_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_86,code=sm_86 -std=c++11
nvcc fatal   : Unsupported gpu architecture 'compute_86'
error: command '/usr/bin/nvcc' failed with exit status 1
lawgeorge202 commented 3 years ago

I think it is no need to edit the cpp_extension.py. That means your PyTorch version is not campatbility with your Cuda. You have installed Cuda11.1, so you should install the corresponding Pytorch. This will be helpful: https://download.pytorch.org/whl/cu111/torch_stable.html

pfvaldez commented 3 years ago

Thanks, I tried both the stable and nightly version.

This is the error

$sudo python3 setup.py install
running install
running bdist_egg
running egg_info
writing neural_renderer_pytorch.egg-info/PKG-INFO
writing dependency_links to neural_renderer_pytorch.egg-info/dependency_links.txt
writing top-level names to neural_renderer_pytorch.egg-info/top_level.txt
reading manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
writing manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'neural_renderer.cuda.load_textures' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/torch/include -I/usr/lib/python3/dist-packages/torch/include/torch/csrc/api/include -I/usr/lib/python3/dist-packages/torch/include/TH -I/usr/lib/python3/dist-packages/torch/include/THC -I/usr/include/python3.6m -c neural_renderer/cuda/load_textures_cuda.cpp -o build/temp.linux-x86_64-3.6/neural_renderer/cuda/load_textures_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++11
/usr/bin/nvcc -I/usr/lib/python3/dist-packages/torch/include -I/usr/lib/python3/dist-packages/torch/include/torch/csrc/api/include -I/usr/lib/python3/dist-packages/torch/include/TH -I/usr/lib/python3/dist-packages/torch/include/THC -I/usr/include/python3.6m -c neural_renderer/cuda/load_textures_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/neural_renderer/cuda/load_textures_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_86,code=sm_86 -std=c++11
nvcc fatal   : Unsupported gpu architecture 'compute_86'
error: command '/usr/bin/nvcc' failed with exit status 1
lawgeorge202 commented 3 years ago

weird... Use command “nvcc -V” to check cuda version. This is the cuda on my machine: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2020 NVIDIA Corporation Built on Tue_Sep_15_19:10:02_PDT_2020 Cuda compilation tools, release 11.1, V11.1.74 Build cuda_11.1.TC455_06.29069683_0

pfvaldez commented 3 years ago

Yup it is weird haha, I use a RTX 3070

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0
~$ nvidia-smi
Sun May  9 12:26:42 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
...
lawgeorge202 commented 3 years ago

I see. You have installed cuda11.2, which is not support by Pytorch currently. You should downgrade to cuda11.1

pfvaldez commented 3 years ago

Thanks for your help I installed cuda 11.1

However get this error

$ sudo python3 setup.py install
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    from torch.utils.cpp_extension import BuildExtension, CUDAExtension
ModuleNotFoundError: No module named 'torch'

Weird, I tried it on both stable and nightly version of pytorch for 11.1 I installed torch, but "setup.py" does not recognize it?

$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.8.1+cu111'
$ pip freeze
dataclasses==0.8
numpy==1.19.5
Pillow==8.2.0
pkg-resources==0.0.0
torch==1.8.1+cu111
torchaudio==0.8.1
torchvision==0.9.1+cu111
typing-extensions==3.10.0.0
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0
$ nvidia-smi
Tue May 11 10:00:23 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.23.05    Driver Version: 455.23.05    CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Graphics Device     Off  | 00000000:09:00.0  On |                  N/A |
|  0%   41C    P8    11W / 220W |    203MiB /  7973MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1127      G   /usr/lib/xorg/Xorg                 18MiB |
|    0   N/A  N/A      1262      G   /usr/bin/gnome-shell               27MiB |
|    0   N/A  N/A      1554      G   /usr/lib/xorg/Xorg                 96MiB |
|    0   N/A  N/A      1682      G   /usr/bin/gnome-shell               57MiB |
+-----------------------------------------------------------------------------+
pfvaldez commented 3 years ago

Update, thank you @Book4man I was able to solve this by installing 'torch' outside the pip environment sudo python3 setup.py install

[sudo] password for pfvaldez: 
running install
running bdist_egg
running egg_info
writing neural_renderer_pytorch.egg-info/PKG-INFO
writing dependency_links to neural_renderer_pytorch.egg-info/dependency_links.txt
writing top-level names to neural_renderer_pytorch.egg-info/top_level.txt
/home/pfvaldez/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py:369: 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.'))
reading manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
writing manifest file 'neural_renderer_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/__init__.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/look.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/projection.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/rasterize.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/lighting.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/load_obj.py -> build/bdist.linux-x86_64/egg/neural_renderer
creating build/bdist.linux-x86_64/egg/neural_renderer/cuda
copying build/lib.linux-x86_64-3.6/neural_renderer/cuda/__init__.py -> build/bdist.linux-x86_64/egg/neural_renderer/cuda
copying build/lib.linux-x86_64-3.6/neural_renderer/cuda/load_textures.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/neural_renderer/cuda
copying build/lib.linux-x86_64-3.6/neural_renderer/cuda/create_texture_image.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/neural_renderer/cuda
copying build/lib.linux-x86_64-3.6/neural_renderer/cuda/rasterize.cpython-36m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/neural_renderer/cuda
copying build/lib.linux-x86_64-3.6/neural_renderer/look_at.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/perspective.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/save_obj.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/mesh.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/vertices_to_faces.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/renderer.py -> build/bdist.linux-x86_64/egg/neural_renderer
copying build/lib.linux-x86_64-3.6/neural_renderer/get_points_from_angles.py -> build/bdist.linux-x86_64/egg/neural_renderer
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/look.py to look.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/projection.py to projection.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/rasterize.py to rasterize.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/lighting.py to lighting.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/load_obj.py to load_obj.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/cuda/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/look_at.py to look_at.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/perspective.py to perspective.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/save_obj.py to save_obj.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/mesh.py to mesh.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/vertices_to_faces.py to vertices_to_faces.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/renderer.py to renderer.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/get_points_from_angles.py to get_points_from_angles.cpython-36.pyc
creating stub loader for neural_renderer/cuda/load_textures.cpython-36m-x86_64-linux-gnu.so
creating stub loader for neural_renderer/cuda/rasterize.cpython-36m-x86_64-linux-gnu.so
creating stub loader for neural_renderer/cuda/create_texture_image.cpython-36m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/cuda/load_textures.py to load_textures.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/cuda/rasterize.py to rasterize.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/neural_renderer/cuda/create_texture_image.py to create_texture_image.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying neural_renderer_pytorch.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying neural_renderer_pytorch.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying neural_renderer_pytorch.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying neural_renderer_pytorch.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
neural_renderer.cuda.__pycache__.create_texture_image.cpython-36: module references __file__
neural_renderer.cuda.__pycache__.load_textures.cpython-36: module references __file__
neural_renderer.cuda.__pycache__.rasterize.cpython-36: module references __file__
creating 'dist/neural_renderer_pytorch-1.1.3-py3.6-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing neural_renderer_pytorch-1.1.3-py3.6-linux-x86_64.egg
removing '/usr/local/lib/python3.6/dist-packages/neural_renderer_pytorch-1.1.3-py3.6-linux-x86_64.egg' (and everything under it)
creating /usr/local/lib/python3.6/dist-packages/neural_renderer_pytorch-1.1.3-py3.6-linux-x86_64.egg
Extracting neural_renderer_pytorch-1.1.3-py3.6-linux-x86_64.egg to /usr/local/lib/python3.6/dist-packages
neural-renderer-pytorch 1.1.3 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.6/dist-packages/neural_renderer_pytorch-1.1.3-py3.6-linux-x86_64.egg
Processing dependencies for neural-renderer-pytorch==1.1.3
Finished processing dependencies for neural-renderer-pytorch==1.1

However when I try the examples...

python3 ./examples/example1.py
Traceback (most recent call last):
  File "./examples/example1.py", line 12, in <module>
    import neural_renderer as nr
ModuleNotFoundError: No module named 'neural_renderer'
ShamLich commented 2 years ago

hello,did you solve this problem now,i can install it successfuly in pytorch 1.7 1.8 ,but can not install in other low versions,can you help me?

kimjson commented 2 years ago

Use pip to install is not support cuda11. It is for old verison. From my experience, the master branch code from https://github.com/adambielski/neural_renderer is work for cuda11. I find it from the pull request.

Why don't you merge this change by asking the fork owner to make PR? What do you say? @adambielski

adambielski commented 2 years ago

Use pip to install is not support cuda11. It is for old verison. From my experience, the master branch code from https://github.com/adambielski/neural_renderer is work for cuda11. I find it from the pull request.

Why don't you merge this change by asking the fork owner to make PR? What do you say? @adambielski

@sundoufu I did make a PR 2 years ago https://github.com/daniilidis-group/neural_renderer/pull/86

kimjson commented 2 years ago

Use pip to install is not support cuda11. It is for old verison. From my experience, the master branch code from https://github.com/adambielski/neural_renderer is work for cuda11. I find it from the pull request.

Why don't you merge this change by asking the fork owner to make PR? What do you say? @adambielski

@sundoufu I did make a PR 2 years ago https://github.com/daniilidis-group/neural_renderer/pull/86

sorry i didn't look into it well even the comment said it was from PR.... so this repo have not been maintained for a long while

rabbityqc commented 2 years ago

可以参考这个博客,我在Linux上试了有效:https://blog.csdn.net/axept/article/details/127359947