Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install neural_renderer_pytorch ERROR: Could not build wheels for neural_renderer_pytorch, which is required to install pyproject.toml-based projects #147

Open
snowmint opened this issue Nov 9, 2023 · 4 comments

Comments

@snowmint
Copy link

snowmint commented Nov 9, 2023

I run the command pip install neural_renderer_pytorch
I tried to install pip install pyproject-toml

Get the error message:

rom neural_renderer/cuda/load_textures_cuda.cpp:1:
      /home/user/anaconda3/envs/texformer/lib/python3.11/site-packages/torch/include/ATen/core/TensorBody.h:222:30: note: declared here
        222 |   DeprecatedTypeProperties & type() const {
            |                              ^~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for neural_renderer_pytorch
  Running setup.py clean for neural_renderer_pytorch
Failed to build neural_renderer_pytorch
ERROR: Could not build wheels for neural_renderer_pytorch, which is required to install pyproject.toml-based projects

But the Error message still appears, what is the possible way to solve this error?
I really appreciate any help you can provide.

@julyaugust12345
Copy link

Have you solved it? I'm afraid I have the same problem

@teethoe
Copy link

teethoe commented Feb 1, 2024

Has anyone solved it? I have the same issue here.

@HenryZhuHR
Copy link

HenryZhuHR commented Apr 11, 2024

PR #86 has changed all AT_CHECK to TORCH_CHECK, so I change all these in 3 files:

  • neural_renderer/cuda/create_texture_image_cuda.cpp
  • neural_renderer/cuda/load_textures_cuda.cpp
  • neural_renderer/cuda/rasterize_cuda.cpp

from

#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) AT_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)

to

#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)

🔨 I solved this problem very coincidentally. You can try it.

(mcc_nmr) zhr@ubuntu-System-Product-Name:~/project/diffusion-attack/libs$ pip install neural_renderer_pytorch/
Processing ./neural_renderer_pytorch
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: neural-renderer-pytorch
  Building wheel for neural-renderer-pytorch (setup.py) ... done
  Created wheel for neural-renderer-pytorch: filename=neural_renderer_pytorch-1.1.3-cp310-cp310-linux_x86_64.whl
  Stored in directory: /tmp/.......
Successfully built neural-renderer-pytorch
Installing collected packages: neural-renderer-pytorch
Successfully installed neural-renderer-pytorch-1.1.3

✅ For convenience, you can directly obtain the modified source code from wangyida/neural_renderer and install neural-renderer-pytorch-1.1.4 directly

git clone git@github.com:wangyida/neural_renderer.git neural_renderer_pytorch_fix
cd neural_renderer_pytorch_fix
python3 setup.py install

🎉 Hope it can help your project!

@1289600760
Copy link

python3 setup.py install

#86AT_CHECK``TORCH_CHECK

#86AT_CHECK``TORCH_CHECK

  • neural_renderer/cuda/create_texture_image_cuda.cpp
  • neural_renderer/cuda/create_texture_image_cuda. cpp
  • neural_renderer/cuda/load_textures_cuda.cpp
  • neural_renderer/cuda/load_textures_cuda. cpp
  • neural_renderer/cuda/rasterize_cuda.cpp
  • neural_renderer/cuda/rasterize_cuda. cpp

from

#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) AT_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)

to

#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor")
#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x " must be contiguous")
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)

🔨 I solved this problem very coincidentally. You can try it.

🔨我非常巧合地解决了这个问题。你可以试试。

(mcc_nmr) zhr@ubuntu-System-Product-Name:~/project/diffusion-attack/libs$ pip install neural_renderer_pytorch/
Processing ./neural_renderer_pytorch
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: neural-renderer-pytorch
  Building wheel for neural-renderer-pytorch (setup.py) ... done
  Created wheel for neural-renderer-pytorch: filename=neural_renderer_pytorch-1.1.3-cp310-cp310-linux_x86_64.whl
  Stored in directory: /tmp/.......
Successfully built neural-renderer-pytorch
Installing collected packages: neural-renderer-pytorch
Successfully installed neural-renderer-pytorch-1.1.3

wangyida/neural_rendererneural-renderer-pytorch-1.1.4

王益达/neural_rendererneural-renderer-pytorch-1.1.4

git clone git@github.com:wangyida/neural_renderer.git neural_renderer_pytorch_fix
cd neural_renderer_pytorch_fix
python3 setup.py install

🎉 Hope it can help your project!

🎉希望能对你的项目有所帮助!

good job!!!thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants