Lakonik / SSDNeRF

[ICCV 2023] Single-Stage Diffusion NeRF
https://lakonik.github.io/ssdnerf/
MIT License
432 stars 23 forks source link

KeyError: 'cond_imgs' when training with the config stage1_*.py #13

Closed windlikestone closed 1 year ago

windlikestone commented 1 year ago

hi, when I training the model with the configs stage1_***.py, it reports

File "train.py", line 81, in main() File "train.py", line 63, in main tools.train.main() File "/mnt/workspace/SSDNeRF/tools/train.py", line 228, in main train_model( File "/mnt/workspace/SSDNeRF/lib/apis/train.py", line 199, in train_model runner.run(data_loaders, cfg.workflow, cfg.total_iters) File "/mnt/workspace/mmgeneration/mmgen/core/runners/dynamic_iterbased_runner.py", line 285, in run iter_runner(iter_loaders[i], kwargs) File "/mnt/workspace/mmgeneration/mmgen/core/runners/dynamic_iterbased_runner.py", line 236, in train self.call_hook('after_train_iter') File "/mnt/workspace/mmgeneration/mmgen/core/runners/dynamic_iterbased_runner.py", line 181, in call_hook getattr(hook, fn_name)(self) File "/mnt/workspace/miniconda3/envs/geom/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, *kwargs) File "/mnt/workspace/SSDNeRF/lib/core/evaluation/eval_hooks.py", line 38, in after_train_iter log_vars = evaluate_3d( File "/mnt/workspace/SSDNeRF/lib/apis/test.py", line 31, in evaluate_3d outputs_dict = model.val_step( File "/mnt/workspace/miniconda3/envs/geom/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 99, in val_step return self.module.val_step(inputs[0], kwargs[0]) File "/mnt/workspace/SSDNeRF/lib/models/autodecoders/base_nerf.py", line 642, in val_step cond_imgs = data['cond_imgs'] # (num_scenes, num_imgs, h, w, 3) KeyError: 'cond_imgs'

I think the stage1 training does not need cond_imags, but the function val_step force to load the cond_imgs from data.

Lakonik commented 1 year ago

Hi! I am unable to reproduce this error using the latest code in this repo.

From your error message, it seems that cond_imgs (i.e. input views) are not loaded during testing. It could be possible that your dataset is not properly set up (e.g., missing testing data), so that the dataloader couldn't find the input views.

windlikestone commented 1 year ago

Thank you very much. Maybe we used the previous code. After we updated the code, this error was fixed.