yihua7 / NeRF-Texture

[SIGGRAPH 2023, TPAMI 2024] Code for NeRF-Texture: Texture Synthesis with Neural Radiance Fields
https://yihua7.github.io/NeRF-Texture-web/
189 stars 10 forks source link

Is `--gui` necessary for training? #1

Closed RuihanGao closed 1 year ago

RuihanGao commented 1 year ago

I am accessing a linux server from Apple M1 MacBook Pro by ssh -Y and try to reproduce the results. I have installed all the packages but get stuck by the following errors when extracting the coarse mesh.

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

I try to remove the flag --gui but got error

CUDA_VISIBLE_DEVICES=0 python main_nerf.py --path data/my_white_lamp_base/ --workspace ./logs/my_white_lamp_base -O --bound 1.0 --scale 0.8 --dt_gamma 0 --ff --mode colmap
Namespace(H=1080, O=True, W=1920, bg_radius=-1, bound=1.0, ckpt='latest', clip_text='', color_space='srgb', cuda_ray=True, density_thresh=10, dt_gamma=0.0, error_map=False, ff=True, fovy=50, fp16=True, gui=False, iters=40000, lr=0.01, max_ray_batch=4096, max_spp=64, max_steps=1024, min_near=0.2, mode='colmap', num_rays=4096, num_steps=512, path='data/my_white_lamp_base/', preload=False, radius=5, rand_pose=-1, scale=0.8, seed=0, tcnn=False, test=False, upsample_steps=0, workspace='./logs/my_white_lamp_base')
Loading trainval data:: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 31/31 [00:00<00:00, 37.61it/s]
[INFO] dataset camera poses: radius = 0.9458, bound = 1.0
NeRFNetwork(
  (encoder): GridEncoder: input_dim=3 num_levels=16 level_dim=2 resolution=16 -> 2048 per_level_scale=1.3819 params=(6098120, 2) gridtype=hash align_corners=True
  (sigma_net): FFMLP: input_dim=32 output_dim=16 hidden_dim=64 num_layers=2 activation=0
  (encoder_dir): SHEncoder: input_dim=3 degree=4
  (color_net): FFMLP: input_dim=32 output_dim=3 hidden_dim=64 num_layers=3 activation=0
)
[INFO] Trainer: ngp | 2023-06-12_23-28-07 | cuda | fp16 | ./logs/my_white_lamp_base
[INFO] #parameters: 12214703
[INFO] Loading latest checkpoint ...
[WARN] No checkpoint found, model randomly initialized.
Loading val data:: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 37.55it/s]
[INFO] dataset camera poses: radius = 1.0909, bound = 1.0
==> Start Training Epoch 1, lr=0.010000 ...
  0% 0/31 [00:00<?, ?it/s]Traceback (most recent call last):
  File "main_nerf.py", line 145, in <module>
    trainer.train(train_loader, valid_loader, max_epoch)
  File "/data/ruihan/projects/NeRF-Texture/nerf/utils.py", line 948, in train
    self.train_one_epoch(train_loader)
  File "/data/ruihan/projects/NeRF-Texture/nerf/utils.py", line 1322, in train_one_epoch
    self.model.update_gridfield(target_stage=int(self.global_step // self.num_iterations_per_stage))
  File "/data/ruihan/anaconda3/envs/ns/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'NeRFNetwork' object has no attribute 'update_gridfield'
  0% 0/31 [00:00<?, ?it/s]

Did you encounter similar OpenGL error and if not, is there a workaround to obtain the training results without using --gui?

yihua7 commented 1 year ago

Hello, my suggestion would be to run the code on a server that has a graphical user interface installed, as the majority of the operations require the use of the GUI control panel where buttons need to be clicked. This will allow for a simplified navigation of the program. The resulting synthesized texture can then be viewed on the GUI window.