Open antithing opened 1 year ago
I have edited neus.py
to add a check:
# update train_num_rays
if out['num_samples_full'].sum().item() > 0:
if self.config.model.dynamic_ray_sampling:
train_num_rays = int(self.train_num_rays * (self.train_num_samples / out['num_samples_full'].sum().item()))
self.train_num_rays = min(int(self.train_num_rays * 0.9 + train_num_rays * 0.1), self.config.model.max_train_num_rays)
And training is now working! However it crashes while trying to create the mesh:
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
Testing DataLoader 0: 100%|████████████████████████████████████████████████████████████| 60/60 [07:52<00:00, 7.88s/it]Traceback (most recent call last):
File "D:\NERF\NEUS\instant-nsr-pl\launch.py", line 128, in <module>
main()
File "D:\NERF\NEUS\instant-nsr-pl\launch.py", line 118, in main
trainer.test(system, datamodule=dm)
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 794, in test
return call._call_and_handle_interrupt(
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\call.py", line 38, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 842, in _test_impl
results = self._run(model, ckpt_path=self.ckpt_path)
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1112, in _run
results = self._run_stage()
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1188, in _run_stage
return self._run_evaluate()
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1228, in _run_evaluate
eval_loop_results = self._evaluation_loop.run()
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\loops\loop.py", line 206, in run
output = self.on_run_end()
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\loops\dataloader\evaluation_loop.py", line 180, in on_run_end
self._evaluation_epoch_end(self._outputs)
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\loops\dataloader\evaluation_loop.py", line 288, in _evaluation_epoch_end
self.trainer._call_lightning_module_hook(hook_name, output_or_outputs)
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\pytorch_lightning\trainer\trainer.py", line 1356, in _call_lightning_module_hook
output = fn(*args, **kwargs)
File "D:\NERF\NEUS\instant-nsr-pl\systems\neus.py", line 259, in test_epoch_end
self.export()
File "D:\NERF\NEUS\instant-nsr-pl\systems\neus.py", line 262, in export
mesh = self.model.export(self.config.export)
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "D:\NERF\NEUS\instant-nsr-pl\models\neus.py", line 315, in export
mesh = self.isosurface()
File "D:\NERF\NEUS\instant-nsr-pl\models\neus.py", line 114, in isosurface
mesh = self.geometry.isosurface()
File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "D:\NERF\NEUS\instant-nsr-pl\models\geometry.py", line 108, in isosurface
vmin, vmax = mesh_coarse['v_pos'].amin(dim=0), mesh_coarse['v_pos'].amax(dim=0)
IndexError: amin(): Expected reduction dim 0 to have non-zero size.
Testing DataLoader 0: 100%|██████████| 60/60 [08:27<00:00, 8.45s/it]
[W C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]
Hi! Which scene are you working on? Does the rendered video look correct? It seems that the scene is empty.
Hi, thanks for getting back to me. I have tried a few different DTU datasets. I am on windows,, could this be related to the fix in the fix-data-win branch?
Thanks!
Hi! This could be related to https://github.com/bennyguo/instant-nsr-pl/issues/45. You may try running the fix-data-win branch and see if you can get any luck. Note that this branch has not been updated for a very long time, so if you could successfully train with this branch, I'll try to update it to the latest HEAD.
Hi @bennyguo, I can confirm that using the fix-win branch runs perfectly (I needed to downgrade the pytorch lightning version) and I can run on the nerf-synthetic dataset, and export a model. If you can add this fix to the latest code, that would be amazing! Thank you again.
Hello! I still get an error, may I ask why?
Hi, thank you for making this available!
I am running on Windows, and when running the example:
python launch.py --config configs/neus-dtu.yaml --gpu 0 --train
I see the following error:
The full output is below, what can I do to resolve this?
Thank you!