hustvl / GaussianDreamer

GaussianDreamer: Fast Generation from Text to 3D Gaussians by Bridging 2D and 3D Diffusion Models (CVPR 2024)
https://taoranyi.com/gaussiandreamer/
Apache License 2.0
589 stars 29 forks source link

Install Error #2

Closed TLB-MISS closed 8 months ago

TLB-MISS commented 8 months ago

First of all, thank you so much for revealing this wonderful work!

I tried setting up the environment following the instructions in the ReadMe, but the same error as shown here appears. However, the solutions on that page will not solve my problem. This is because that solution requires the latest torch and the latest diff-gaussian-rasterization, while GaussianDreamer does not use the latest diff-gaussian-rasterization(There are some modules whose input/output is different from the latest version).

My environment GPU : A5000 CUDA : 11.8 or 11.7 torch : 1.12.1 or 2.0.0 or 2.0.1 (I am getting the same error while installing diff-gaussian-rasterization in all versions.)

Could you please give me some advice? Thanks.

Cazforshort commented 8 months ago

Can confirm, noticed the same thing and posted about it at coincidentally the same exact time.

taoranyi commented 8 months ago

Thank you for your attention. I'm sorry that I haven't tested on Windows. One solution is to replace the current implementation with the latest diff-gaussian-rasterization and remove the depth output during rendering. I will try to solve this problem later when I have time.

TLB-MISS commented 8 months ago

@taoranyi

Oh, I'm using ubuntu. This issue also occurred when installing DreamGaussian, but in the case of DreamGaussian, it was resolved with the solution here.

taoranyi commented 8 months ago

Here is a possible way. Currently, our diff-gaussian-rasterization comes from here, which you can replace with this: diff-gaussian-rasterization. It is worth noting that the rasterizer should be modified appropriately. If this works, please let me know!

TLB-MISS commented 8 months ago

@taoranyi

I already tried it yesterday. However, as you said, the input/output had to be modified, so I didn't look into it in depth.

I don't have time to look into the rasterizer right now, so I'll try tomorrow or the day after!

taoranyi commented 8 months ago

Thanks!!!!!!!!!!!!!! I will be very grateful!

Cazforshort commented 8 months ago

I was able to get it up and running by downloading this rasterizer and running these exact steps.

I don't think it everything is playing well since it doesn't seem like it is outputting any results anywhere, but maybe I just don't know what to look for?

EDIT: I forgot to mention that I added torch=2.0.1 to the requirements file since it kept getting upgraded!

conda remove -n gau_env --all conda create -n gau_env python=3.9 conda activate gau_env conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia pip install ninja pip install -r requirements.txt cd .. pip install gaussian-splatting/submodules/diff-gaussian-rasterization pip install gaussian-splatting/submodules/simple-knn cd .\GaussianDreamer\shap-e pip install -e . pip install bitsandbytes-windows conda install -c anaconda ipywidgets pip install open3d conda install -c conda-forge plyfile

python launch.py --config configs/gaussiandreamer-sd.yaml --train --gpu 0 system.prompt_processor.prompt="a fox"

Not sure if this helps at all, but here the output:

image
Cazforshort commented 8 months ago

Here is a possible way. Currently, our diff-gaussian-rasterization comes from here, which you can replace with this: diff-gaussian-rasterization. It is worth noting that the rasterizer should be modified appropriately. If this works, please let me know!

I get a ton of errors when trying to install that other replacement for some reason. Ends about the same as the other errors though.

File "C:\Users\xxx\Programs\miniconda\envs\gau_env\lib\site-packages\torch\utils\cpp_extension.py", line 1574, in _write_ninja_file_and_compile_objects
          _run_ninja_build(
        File "C:\Users\xxx\Programs\miniconda\envs\gau_env\lib\site-packages\torch\utils\cpp_extension.py", line 1909, in _run_ninja_build
          raise RuntimeError(message) from e
      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 diff-gaussian-rasterization
  Running setup.py clean for diff-gaussian-rasterization
Failed to build diff-gaussian-rasterization
TLB-MISS commented 8 months ago

@taoranyi @Cazforshort

I fixed it.

  1. Erase original diff-gaussian-rasterization directory
  2. git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization in GaussianDreamer/gaussiansplatting/submodules
  3. Follow the instructions here
  4. pip install ./gaussiansplatting/submodules/diff-gaussian-rasterization
  5. Fix raster_settings : Add debug=False as the last argument
  6. Fix rasterizer : rendered_image, radii, depth, _ = Because lastest gaussian rasterizers output alpha values.
TLB-MISS commented 8 months ago

@taoranyi

I have additional question. How can I get 3D mesh? It seems that GaussianDreamer can only output point clouds.

Cazforshort commented 8 months ago

@taoranyi @Cazforshort

I fixed it.

  1. Erase original diff-gaussian-rasterization directory
  2. git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization in GaussianDreamer/gaussiansplatting/submodules
  3. Follow the instructions here
  4. pip install ./gaussiansplatting/submodules/diff-gaussian-rasterization
  5. Fix raster_settings : Add debug=False as the last argument
  6. Fix rasterizer : rendered_image, radii, depth, _ = Because lastest gaussian rasterizers output alpha values.

You were able to get it to work with cuda 11.8? I thought only 11.7 would work with 2.0.1 pytorch

Following those steps I get AttributeError: 'GaussianDreamer' object has no attribute 'geometry' when trying to export and raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'GaussianDreamer' object has no attribute 'pipe' when trying to train

Cazforshort commented 8 months ago

The raster changes worked for me too, but I had to stick with cuda 11.7 not 11.8. It also saves a copy of the entire codebase each time? Thats a weird one.

taoranyi commented 8 months ago

@TLB-MISS I haven't yet touched on how to convert a 3D Gaussians into a mesh, so you may have to look it up yourself.

y-71 commented 8 months ago

@taoranyi @Cazforshort

I fixed it.

  1. Erase original diff-gaussian-rasterization directory
  2. git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization in GaussianDreamer/gaussiansplatting/submodules
  3. Follow the instructions here
  4. pip install ./gaussiansplatting/submodules/diff-gaussian-rasterization
  5. Fix raster_settings : Add debug=False as the last argument
  6. Fix rasterizer : rendered_image, radii, depth, _ = Because lastest gaussian rasterizers output alpha values.

I've created a fork with the changes, i initially did it to make it work on colab, so for the lazy people out there, help yourself.

https://github.com/y-71/GaussianDreamer/

Cazforshort commented 8 months ago

@taoranyi @Cazforshort I fixed it.

  1. Erase original diff-gaussian-rasterization directory
  2. git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization in GaussianDreamer/gaussiansplatting/submodules
  3. Follow the instructions here
  4. pip install ./gaussiansplatting/submodules/diff-gaussian-rasterization
  5. Fix raster_settings : Add debug=False as the last argument
  6. Fix rasterizer : rendered_image, radii, depth, _ = Because lastest gaussian rasterizers output alpha values.

I've created a fork with the changes, i initially did it to make it work on colab, so for the lazy people out there, help yourself.

https://github.com/y-71/GaussianDreamer/

Where are you getting the ply? I'm just seeing pictures when I run the training example.

TLB-MISS commented 8 months ago

@Cazforshort

I don't know exactly what your situation is. In my case, there was a ply file in the save folder.

TLB-MISS commented 8 months ago

I think this issue can be closed

Cazforshort commented 8 months ago

@Cazforshort

I don't know exactly what your situation is. In my case, there was a ply file in the save folder.

Ah something must be wrong since I don't have any ply in my save folder after training.

cwwjyh commented 8 months ago

I was able to get it up and running by downloading this rasterizer and running these exact steps.

I don't think it everything is playing well since it doesn't seem like it is outputting any results anywhere, but maybe I just don't know what to look for?

EDIT: I forgot to mention that I added torch=2.0.1 to the requirements file since it kept getting upgraded!

conda remove -n gau_env --all conda create -n gau_env python=3.9 conda activate gau_env conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia pip install ninja pip install -r requirements.txt cd .. pip install gaussian-splatting/submodules/diff-gaussian-rasterization pip install gaussian-splatting/submodules/simple-knn cd .\GaussianDreamer\shap-e pip install -e . pip install bitsandbytes-windows conda install -c anaconda ipywidgets pip install open3d conda install -c conda-forge plyfile

python launch.py --config configs/gaussiandreamer-sd.yaml --train --gpu 0 system.prompt_processor.prompt="a fox"

Not sure if this helps at all, but here the output: image

i run the follow success: pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu117 pip install ninja pip install -r requirements.txt then it will appear : torchaudio 2.0.2+cu117 requires torch==2.0.1, but you have torch 2.1.0 which is incompatible. fix use: pip install torch==2.0.1 torchvision===0.15.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/ pip install xformers==0.0.20

git clone https://github.com/hustvl/GaussianDreamer.git cd GaussianDreamer pip install ./gaussiansplatting/submodules/diff-gaussian-rasterization pip install ./gaussiansplatting/submodules/simple-knn git clone https://github.com/openai/shap-e.git cd shap-e pip install -e .

pip install ipywidgets pip install open3d pip install plyfile

python launch.py --config configs/gaussiandreamer-sd.yaml --train --gpu 0 system.prompt_processor.prompt="a fox"

Then it can be running

tsabbir96 commented 7 months ago

@taoranyi @Cazforshort I fixed it.

  1. Erase original diff-gaussian-rasterization directory
  2. git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization in GaussianDreamer/gaussiansplatting/submodules
  3. Follow the instructions here
  4. pip install ./gaussiansplatting/submodules/diff-gaussian-rasterization
  5. Fix raster_settings : Add debug=False as the last argument
  6. Fix rasterizer : rendered_image, radii, depth, _ = Because lastest gaussian rasterizers output alpha values.

I've created a fork with the changes, i initially did it to make it work on colab, so for the lazy people out there, help yourself.

https://github.com/y-71/GaussianDreamer/

@y-71 that's so cool, I am struggling really hard to get it installed on Colab.. What did you do? I faced so much issue but finally was able to get it up and running. I wanted to know what you did to understand if we both were getting same errors.. Would you like to share the link to the colab notebook?