chensjtu / GaussianObject

GaussianObject: High-Quality 3D Object Reconstruction from Four Views with Gaussian Splatting (SIGGRAPH Asia 2024, TOG)
887 stars 54 forks source link

error running in render.py #60

Open hongchiMa opened 1 week ago

hongchiMa commented 1 week ago

When I run the following command:

python render.py \
    -m output/gs_init/rabbit \
    --sparse_view_num 4 --sh_degree 2 \
    --init_pcd_name dust3r_4 \
    --dust3r_json output/gs_init/rabbit/refined_cams.json \
    --white_background --render_path --use_dust3r

I encounter the following error:

Looking for config file in output/gs_init/rabbit/cfg_args
Config file found: output/gs_init/rabbit/cfg_args
Rendering output/gs_init/rabbit
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
/home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future. Please use 'weights' instead.
  warnings.warn(
/home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=VGG16_Weights.IMAGENET1K_V1`. You can also use `weights=VGG16_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Loading model from: /home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/lpips/weights/v0.1/vgg.pth
Loading trained model at iteration 10000 [18/10 19:43:10]
Using resized images in /media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/data/realcap/rabbit/images_8... [18/10 19:43:10]
Generating ellipse path from 4 camera infos ... [18/10 19:43:10]
theta[0] 0.0 [18/10 19:43:10]
Loading training cameras took 0.2026 seconds [18/10 19:43:11]
Loading test cameras took 0.000034 seconds [18/10 19:43:11]
Loading render cameras took 0.0303 seconds [18/10 19:43:11]
Rendering progress:   0%|                                                                                                                                 | 0/120 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/render.py", line 365, in <module>
    render_path(model.extract(args), args.iteration, pipeline.extract(args), extra_opts=args)
  File "/home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/render.py", line 305, in render_path
    render_pkg = render(view, gaussians, pipeline, background)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/gaussian_renderer/__init__.py", line 37, in render
    raster_settings = GaussianRasterizationSettings(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GaussianRasterizationSettings.__new__() missing 1 required positional argument: 'projmatrix_raw'

Could you please provide guidance on how to resolve this issue?

Dumeowmeow commented 1 week ago

When I run the following command:

python render.py \
    -m output/gs_init/rabbit \
    --sparse_view_num 4 --sh_degree 2 \
    --init_pcd_name dust3r_4 \
    --dust3r_json output/gs_init/rabbit/refined_cams.json \
    --white_background --render_path --use_dust3r

I encounter the following error:

Looking for config file in output/gs_init/rabbit/cfg_args
Config file found: output/gs_init/rabbit/cfg_args
Rendering output/gs_init/rabbit
Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off]
/home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future. Please use 'weights' instead.
  warnings.warn(
/home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=VGG16_Weights.IMAGENET1K_V1`. You can also use `weights=VGG16_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Loading model from: /home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/lpips/weights/v0.1/vgg.pth
Loading trained model at iteration 10000 [18/10 19:43:10]
Using resized images in /media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/data/realcap/rabbit/images_8... [18/10 19:43:10]
Generating ellipse path from 4 camera infos ... [18/10 19:43:10]
theta[0] 0.0 [18/10 19:43:10]
Loading training cameras took 0.2026 seconds [18/10 19:43:11]
Loading test cameras took 0.000034 seconds [18/10 19:43:11]
Loading render cameras took 0.0303 seconds [18/10 19:43:11]
Rendering progress:   0%|                                                                                                                                 | 0/120 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/render.py", line 365, in <module>
    render_path(model.extract(args), args.iteration, pipeline.extract(args), extra_opts=args)
  File "/home/mhc/anaconda3/envs/go/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/render.py", line 305, in render_path
    render_pkg = render(view, gaussians, pipeline, background)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/mhc/3a4fd668-aad6-4dc1-8e1c-abadec010d68/project/GaussianObject/gaussian_renderer/__init__.py", line 37, in render
    raster_settings = GaussianRasterizationSettings(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GaussianRasterizationSettings.__new__() missing 1 required positional argument: 'projmatrix_raw'

Could you please provide guidance on how to resolve this issue?

reinstall it: pip install submodules/diff-gaussian-rasterization/