graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
14.67k stars 1.92k forks source link

Fail to install diff-gaussian-rasterization #642

Open evearmadillo opened 9 months ago

evearmadillo commented 9 months ago

Hello, I've followed https://github.com/henrypearce4D advice on adding VS path to env variables, but I ran into this error:

(base) C:\Users\evebo\gaussian-splatting>git submodule update --init --recursive
Submodule path 'submodules/diff-gaussian-rasterization': checked out '59f5f77e3ddbac3ed9db93ec2cfe99ed6c5d121d'
Submodule path 'submodules/diff-gaussian-rasterization/third_party/glm': checked out '5c46b9c07008ae65cb81ab79cd677ecc1934b903'

(base) C:\Users\evebo\gaussian-splatting>pip install submodules\diff-gaussian-rasterization
Processing c:\users\evebo\gaussian-splatting\submodules\diff-gaussian-rasterization
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\evebo\gaussian-splatting\submodules\diff-gaussian-rasterization\setup.py", line 13, in <module>
          from torch.utils.cpp_extension import CUDAExtension, BuildExtension
      ModuleNotFoundError: No module named 'torch'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

In the gaussian-renderer init.py code there're missing imports from GaussianRasterization.

How can I resolve this? Thank you in advance!

LoickCh commented 9 months ago

Do you have torch installed ? Otherwise you can not import CUDA extensions in setup.py

evearmadillo commented 9 months ago

Do you have torch installed ? Otherwise you can not import CUDA extensions in setup.py

>>> import torch
>>> print ("PyTorch version:" , torch.__version__)
PyTorch version: 1.12.1
>>> print("CUDA available:" , torch.cuda.is_available())
CUDA available: True
>>>

Yes, pytorch is 1.12.1, or should I install something extra? I'm so confused, it always comes up with the same error

Type-Here commented 9 months ago

Hi, from your log, you're in the base environment of conda while the yml file of the guide automatically creates a gaussian_splatting env. Could this be the problem? Maybe try conda activate gaussian_splatting first.

vitorpmh commented 1 month ago

The problem for me was fixed after i gave up on python-venvs and used conda-venv.