threestudio-project / threestudio

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

Stage 2 failed #123

Open tonymacx86PRO opened 1 year ago

tonymacx86PRO commented 1 year ago

What I executed: !python launch.py --config configs/prolificdreamer-geometry.yaml --train --gpu 0 system.prompt_processor.prompt="$prompt" system.geometry_convert_from=outputs/prolificdreamer/a_zoomed_out_DSLR_photo_of_a_cardboard_realistic_box@20230613-143945/ckpts/last.ckpt I run ProlificDreamer on google colab T4 but I got this error when i need to go to the next stage

2023-06-13 16:59:53.988295: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Global seed set to 0
[INFO] Initializing geometry from a given checkpoint ...
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /content/threestudio/launch.py:180 in <module>                               │
│                                                                              │
│   177                                                                        │
│   178                                                                        │
│   179 if __name__ == "__main__":                                             │
│ ❱ 180 │   main()                                                             │
│   181                                                                        │
│                                                                              │
│ /content/threestudio/launch.py:108 in main                                   │
│                                                                              │
│   105 │   pl.seed_everything(cfg.seed)                                       │
│   106 │                                                                      │
│   107 │   dm = threestudio.find(cfg.data_type)(cfg.data)                     │
│ ❱ 108 │   system: BaseSystem = threestudio.find(cfg.system_type)(            │
│   109 │   │   cfg.system, resumed=cfg.resume is not None                     │
│   110 │   )                                                                  │
│   111 │   system.set_save_dir(os.path.join(cfg.trial_dir, "save"))           │
│                                                                              │
│ /content/threestudio/threestudio/systems/base.py:40 in __init__              │
│                                                                              │
│    37 │   │   if "loggers" in cfg:                                           │
│    38 │   │   │   self.create_loggers(cfg.loggers)                           │
│    39 │   │                                                                  │
│ ❱  40 │   │   self.configure()                                               │
│    41 │   │   if self.cfg.weights is not None:                               │
│    42 │   │   │   self.load_weights(self.cfg.weights, self.cfg.weights_ignor │
│    43 │   │   self.post_configure()                                          │
│                                                                              │
│ /content/threestudio/threestudio/systems/prolificdreamer.py:25 in configure  │
│                                                                              │
│    22 │                                                                      │
│    23 │   def configure(self) -> None:                                       │
│    24 │   │   # set up geometry, material, background, renderer              │
│ ❱  25 │   │   super().configure()                                            │
│    26 │   │                                                                  │
│    27 │   │   self.guidance = threestudio.find(self.cfg.guidance_type)(self. │
│    28 │   │   self.prompt_processor = threestudio.find(self.cfg.prompt_proce │
│                                                                              │
│ /content/threestudio/threestudio/systems/base.py:249 in configure            │
│                                                                              │
│   246 │   │   │   prev_geometry.do_update_step(epoch, global_step, on_load_w │
│   247 │   │   │   # convert from coarse stage geometry                       │
│   248 │   │   │   prev_geometry = prev_geometry.to(get_device())             │
│ ❱ 249 │   │   │   self.geometry = threestudio.find(self.cfg.geometry_type).c │
│   250 │   │   │   │   prev_geometry,                                         │
│   251 │   │   │   │   self.cfg.geometry,                                     │
│   252 │   │   │   │   copy_net=self.cfg.geometry_convert_inherit_texture,    │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py:115 in    │
│ decorate_context                                                             │
│                                                                              │
│   112 │   @functools.wraps(func)                                             │
│   113 │   def decorate_context(*args, **kwargs):                             │
│   114 │   │   with ctx_factory():                                            │
│ ❱ 115 │   │   │   return func(*args, **kwargs)                               │
│   116 │                                                                      │
│   117 │   return decorate_context                                            │
│   118                                                                        │
│                                                                              │
│ /content/threestudio/threestudio/models/geometry/tetrahedra_sdf_grid.py:198  │
│ in create_from                                                               │
│                                                                              │
│   195 │   │   │   │   threestudio.warn(                                      │
│   196 │   │   │   │   │   f"Override isosurface_resolution of the source geo │
│   197 │   │   │   │   )                                                      │
│ ❱ 198 │   │   │   mesh = other.isosurface()                                  │
│   199 │   │   │   instance.isosurface_bbox = mesh.extras["bbox"]             │
│   200 │   │   │   instance.sdf.data = (                                      │
│   201 │   │   │   │   mesh.extras["grid_level"].to(instance.sdf.data).clamp( │
│                                                                              │
│ /content/threestudio/threestudio/models/geometry/base.py:180 in isosurface   │
│                                                                              │
│   177 │   │   if self.cfg.isosurface_coarse_to_fine:                         │
│   178 │   │   │   threestudio.debug("First run isosurface to get a tight bou │
│   179 │   │   │   with torch.no_grad():                                      │
│ ❱ 180 │   │   │   │   mesh_coarse = self._isosurface(self.bbox)              │
│   181 │   │   │   vmin, vmax = mesh_coarse.v_pos.amin(dim=0), mesh_coarse.v_ │
│   182 │   │   │   vmin_ = (vmin - (vmax - vmin) * 0.1).max(self.bbox[0])     │
│   183 │   │   │   vmax_ = (vmax + (vmax - vmin) * 0.1).min(self.bbox[1])     │
│                                                                              │
│ /content/threestudio/threestudio/models/geometry/base.py:167 in _isosurface  │
│                                                                              │
│   164 │   │   if self.cfg.isosurface_remove_outliers:                        │
│   165 │   │   │   # remove outliers components with small number of faces    │
│   166 │   │   │   # only enabled when the mesh is not differentiable         │
│ ❱ 167 │   │   │   mesh = mesh.remove_outlier(self.cfg.isosurface_outlier_n_f │
│   168 │   │                                                                  │
│   169 │   │   return mesh                                                    │
│   170                                                                        │
│                                                                              │
│ /content/threestudio/threestudio/models/mesh.py:59 in remove_outlier         │
│                                                                              │
│    56 │   │   if isinstance(outlier_n_faces_threshold, float):               │
│    57 │   │   │   # set the threshold to the number of faces in the largest  │
│    58 │   │   │   n_faces_threshold = int(                                   │
│ ❱  59 │   │   │   │   max([c.faces.shape[0] for c in components]) * outlier_ │
│    60 │   │   │   )                                                          │
│    61 │   │   else:                                                          │
│    62 │   │   │   # set the threshold directly to outlier_n_faces_threshold  │
╰──────────────────────────────────────────────────────────────────────────────╯
ValueError: max() arg is an empty sequence

idk what is happening

bennyguo commented 1 year ago

Hi! It seems like the extracted mesh is empty. Could you provide the rendered video from the first stage? You may want to try adding system.geometry_convert_override.isosurface_threshold=some_value where some_value is some number lower than the default value (20).

tonymacx86PRO commented 1 year ago

Stage 1 - 5512 steps (Very strange because the geometry exists) I passed the last.ckpt and throws issue. And the Colab machine is dead, but I saved the project. And where i need to add that? system.geometry_convert_override.isosurface_threshold=some_value

qxzha commented 1 year ago

if anyone knows how to fix this problem,please tell me

bennyguo commented 1 year ago

Stage 1 - 5512 steps (Very strange because the geometry exists) I passed the last.ckpt and throws issue. And the Colab machine is dead, but I saved the project. And where i need to add that? system.geometry_convert_override.isosurface_threshold=some_value

Just add this right after your running command:

!python launch.py some_existing_parameters system.geometry_convert_override.isosurface_threshold=some_value
SoftologyPro commented 1 year ago

What is the default value for "system.geometry_convert_override.isosurface_threshold" if one is not specified?