threestudio-project / threestudio

A unified framework for 3D content generation.
Apache License 2.0
6.28k stars 478 forks source link

How to export Mesh in GaussianDreamer? (Missing mandatory value: tag error) #453

Open hayoung-jeremy opened 7 months ago

hayoung-jeremy commented 7 months ago

summary

reproduction of the error

bennyguo commented 7 months ago

Please try setting --config as outputs/gs-sds-mvdream/an_astronaut_wearing_a_blue_suit@20240329-022833/configs/parsed.yaml.

hayoung-jeremy commented 7 months ago

Thanks, but encountered another error :

bennyguo commented 7 months ago

If so, it means that this Gaussian model does not support mesh extraction :(

codyreading commented 6 months ago

Hey @hayoung-jeremy

You need to remove system.exporter_type=mesh-exporter from your command.

If you take a look at the gaussiandreamer_mvdream.yaml config it uses gaussiandreamer-mesh-exporter

Although now I'm getting this error now:

Traceback (most recent call last):
  File "/home/cra80/Projects/threestudio/launch.py", line 332, in <module>
    main(args, extras)
  File "/home/cra80/Projects/threestudio/launch.py", line 290, in main
    trainer.predict(system, datamodule=dm, ckpt_path=cfg.resume)
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 864, in predict
    return call._call_and_handle_interrupt(
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/trainer/call.py", line 44, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 903, in _predict_impl
    results = self._run(model, ckpt_path=ckpt_path)
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 987, in _run
    results = self._run_stage()
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1028, in _run_stage
    return self.predict_loop.run()
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/loops/utilities.py", line 182, in _decorator
    return loop_run(self, *args, **kwargs)
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/loops/prediction_loop.py", line 130, in run
    return self.on_run_end()
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/loops/prediction_loop.py", line 202, in on_run_end
    results = self._on_predict_epoch_end()
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/loops/prediction_loop.py", line 368, in _on_predict_epoch_end
    call._call_lightning_module_hook(trainer, "on_predict_epoch_end")
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/pytorch_lightning/trainer/call.py", line 157, in _call_lightning_module_hook
    output = fn(*args, **kwargs)
  File "/home/cra80/Projects/threestudio/threestudio/systems/base.py", line 335, in on_predict_epoch_end
    exporter_output: List[ExporterOutput] = self.exporter()
  File "/home/cra80/Projects/threestudio/custom/threestudio-gaussiandreamer/geometry/exporter.py", line 35, in __call__
    mesh: Mesh = self.geometry.extract_mesh()
  File "/home/cra80/Projects/threestudio/custom/threestudio-gaussiandreamer/geometry/gaussian_io.py", line 268, in extract_mesh
    occ = self.extract_fields(resolution).detach().cpu().numpy()
  File "/home/cra80/miniconda3/envs/threestudio-torch222/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/cra80/Projects/threestudio/custom/threestudio-gaussiandreamer/geometry/gaussian_io.py", line 247, in extract_fields
    w = gaussian_3d_coeff(
NameError: name 'gaussian_3d_coeff' is not defined
codyreading commented 6 months ago

Fixed in here: https://github.com/cxh0519/threestudio-gaussiandreamer/pull/8