Anttwo / SuGaR

[CVPR 2024] Official PyTorch implementation of SuGaR: Surface-Aligned Gaussian Splatting for Efficient 3D Mesh Reconstruction and High-Quality Mesh Rendering
https://anttwo.github.io/sugar/
Other
2.36k stars 182 forks source link

Installing pytorch3d on Windows #120

Closed enrac5 closed 10 months ago

enrac5 commented 10 months ago

Hi there, has anyone else tried installing this on Windows? How did you get past the PyTorch3d issue?

kitmallet commented 10 months ago

@enrac5 This si what I used: git clone https://github.com/facebookresearch/pytorch3d.git cd pytorch3d && pip install -e .

enrac5 commented 10 months ago

Thanks @kitmallet that seemed to help. I'm now stuck on this part:

cd gaussian_splatting/submodules/diff-gaussian-rasterization/ pip install -e . cd ../simple-knn/ pip install -e . cd ../../../

The second step errors with a lot of errors, but the first one looks like:

No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8'

Which is odd, since that directory does exist and there's a bin folder and everything.

kitmallet commented 10 months ago

I installed from here: https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md From 2. Install from a clone at bottom of page. There is more info there and another step may be needed. Good luck. If you need any more help let me know. Took me a long time to get it going. Best, Kit

kitmallet commented 10 months ago

Did you add CUDA to Environment variabilities?

enrac5 commented 10 months ago

Did you add CUDA to Environment variabilities?

Yeah it's there. Looks like restarting the machine worked (and also walking outside and screaming, scaring the local kids)....

kitmallet commented 10 months ago

Hahaha. When in doubt…. Restart! I just stay inside and scream at my own kids!!!On Jan 27, 2024, at 1:41 PM, enrac5 @.***> wrote:

Did you add CUDA to Environment variabilities?

Yeah it's there. Looks like restarting the machine worked (and also walking outside and screaming, scaring the local kids)....

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

enrac5 commented 10 months ago

@kitmallet Okay, so this is weird, when I do the last step in the readme, I get an error:

Traceback (most recent call last): File "C:\dev\SuGaR\train.py", line 3, in <module> from sugar_trainers.coarse_density import coarse_training_with_density_regularization File "C:\dev\SuGaR\sugar_trainers\coarse_density.py", line 5, in <module> from pytorch3d.loss import mesh_laplacian_smoothing, mesh_normal_consistency ModuleNotFoundError: No module named 'pytorch3d'

I thought I'd installed it...

kitmallet commented 10 months ago

When you did: cd pytorch3d && pip install -e . Did you make sure to include the period at the end?

enrac5 commented 10 months ago

@kitmallet So, it looks like I needed to install it in the sugar conda context. Now, the training went along, but there's this weird error:

Traceback (most recent call last): File "C:\dev\SuGaR\train.py", line 170, in <module> refined_sugar_path = refined_training(refined_args) File "C:\dev\SuGaR\sugar_trainers\refine.py", line 319, in refined_training os.makedirs(sugar_checkpoint_path, exist_ok=True) File "C:\Users\enrac\.conda\envs\sugar\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "C:\Users\enrac\.conda\envs\sugar\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "C:\Users\enrac\.conda\envs\sugar\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) [Previous line repeated 7 more times] File "C:\Users\enrac\.conda\envs\sugar\lib\os.py", line 225, in makedirs mkdir(name, mode) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\dev\\test_scenes\\tandt\\truck\\sugarfine_C:'

Notice the malformed path on the last line. Do I need to update my pull?

kitmallet commented 10 months ago

Have you tried running each of the 4 steps independently? Starting with train_coarse_sdf.py and then the others?

enrac5 commented 10 months ago

Have you tried running each of the 4 steps independently? Starting with train_coarse_sdf.py and then the others?

I did this first: python gaussian_splatting/train.py -s <path to COLMAP dataset> --iterations 7000 -m <path to the desired output directory>

And then this step (as noted in the docs):

python train.py -s <path to COLMAP dataset> -c <path to the Gaussian Splatting checkpoint> -r <"density" or "sdf">

which is where I'm stuck with that weird pathing error. I'm assuming this works out of the box. This is how I run the command in the sugar directory:

python train.py -s C:\dev\test_scenes\tandt\truck\ -c C:\tmp\trn_op\ -r "density"

Now I'm curious, @kitmallet is there another set of instructions with more steps that I'm missing? I don't immediately see where in the readme document train_coarse_sdf.py is mentioned.

kitmallet commented 10 months ago

Try running this: python train_coarse_density.py -s C:\dev\test_scenes\tandt\truck\ -c C:\tmp\trn_op\

enrac5 commented 10 months ago

Try running this: python train_coarse_density.py -s C:\dev\test_scenes\tandt\truck\ -c C:\tmp\trn_op\

Trying this now....

enrac5 commented 10 months ago

Oh! It says, "Final model saved" .... where did it save it to?

kitmallet commented 10 months ago

It was probably saved in mesh/truck?

kitmallet commented 10 months ago

You can email me at kit@3deproductions.com so we don’t fill up this board.