AiuniAI / Unique3D

Official implementation of Unique3D: High-Quality and Efficient 3D Mesh Generation from a Single Image
https://wukailu.github.io/Unique3D/
MIT License
1.96k stars 131 forks source link

Failed to build pytorch3d #29

Open Rocky77JHxu opened 1 week ago

Rocky77JHxu commented 1 week ago

I encountered an error called Failed to build pytorch3d while executing pip install - r requirements. txt. The error log is as follows:

      RuntimeError: Error compiling objects for extension
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pytorch3d
  Running setup.py clean for pytorch3d
  Building wheel for torch_scatter (setup.py) ... done
  Created wheel for torch_scatter: filename=torch_scatter-2.1.2-cp310-cp310-linux_x86_64.whl size=3647418 sha256=f42ba18f4aafbad4fd13620326717c7f098f93ecf4fd6a2d706e901260812b77
  Stored in directory: /root/.cache/pip/wheels/9d/6e/0b/a62ae17c8ce8fab819b1a70474c12cc3dc267609bee787c4c2
  Building wheel for ffmpy (setup.py) ... done
  Created wheel for ffmpy: filename=ffmpy-0.3.2-py3-none-any.whl size=5584 sha256=74de057f87dc026e07c46aa46a83fbf561160231e89dd738c0bd27acb83c478b
  Stored in directory: /root/.cache/pip/wheels/f1/33/b9/967f1c6df43a4e6759a80bcc23e335ad8ea0d3c7be950bdcc7
  Building wheel for fvcore (setup.py) ... done
  Created wheel for fvcore: filename=fvcore-0.1.5.post20221221-py3-none-any.whl size=61400 sha256=1cea27ff73c18c0d4f7939ce358a4c65831ca47ea629442249fd193b4b5e7d42
  Stored in directory: /root/.cache/pip/wheels/94/f7/16/11182b7c4ea4d2a6d87f3f6826a04b6214904a532a6419bfb0
  Building wheel for iopath (setup.py) ... done
  Created wheel for iopath: filename=iopath-0.1.10-py3-none-any.whl size=31532 sha256=ddcf3b2b204f75d69f6b018878620d44c46a3f2a7fe0e30b680399529dfd7b19
  Stored in directory: /root/.cache/pip/wheels/cf/6d/3f/6437c8347956c6d3ec82504526b91303375637e775d08abb27
Successfully built fire nvdiffrast antlr4-python3-runtime pygltflib torch_scatter ffmpy fvcore iopath
Failed to build pytorch3d
ERROR: Could not build wheels for pytorch3d, which is required to install pyproject.toml-based projects

Here is my version information and execution process:

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0
$ python
Python 3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
2.1.0+cu121
$ conda create -n unique3d python=3.11
$ conda activate unique3d
$ pip install ninja
$ pip install diffusers==0.27.2
$ pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
$ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.1/index.html
$ pip install -r requirements.txt
jtydhr88 commented 1 week ago

building pytorch3d failure is a big story but not relevent to this project, it is normally caused by your local env configuration. might you could share the full error log to help others understand the error.

wukailu commented 1 week ago

As stated in the Pytorch3D installation guide, the most convenient way is to install the pre-compiled version directly.

import sys
import torch
pyt_version_str=torch.__version__.split("+")[0].replace(".", "")
version_str="".join([
    f"py3{sys.version_info.minor}_cu",
    torch.version.cuda.replace(".",""),
    f"_pyt{pyt_version_str}"
])
!pip install fvcore iopath
!pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html