google / nerfies

This is the code for Deformable Neural Radiance Fields, a.k.a. Nerfies.

Home Page:https://nerfies.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with Nerfies_Render_Video.ipynb

KimMingyeol opened this issue · comments

commented

Hi, I faced an error while running Nerfies_Render_Video.ipynb on jupyter notebook.

from nerfies import datasets
from nerfies import image_utils

datasource = datasets.from_config(
exp_config.datasource_spec,
image_scale=exp_config.image_scale,
use_appearance_id=model_config.use_appearance_metadata,
use_camera_id=model_config.use_camera_metadata,
use_warp_id=model_config.use_warp,
random_seed=exp_config.random_seed)

show_image(datasource.load_rgb(datasource.train_ids[0]))

I ran this section, and got an error below.

TypeError Traceback (most recent call last)
in
4 from nerfies import image_utils
5
----> 6 datasource = datasets.from_config(
7 exp_config.datasource_spec,
8 image_scale=exp_config.image_scale,

~/Codes/nerfies/nerfies/datasets/init.py in from_config(spec, **kwargs)
20 def from_config(spec, **kwargs):
21 """Create a datasource from a config specification."""
---> 22 spec = dict(spec)
23 ds_type = spec.pop('type')
24 if ds_type == 'nerfies':

TypeError: 'NoneType' object is not iterable

Any ideas for solving this problem?
Thanks.

commented

I solved it by modifying that section as follows. (referenced from eval.py)

from nerfies import datasets
from nerfies import image_utils

datasource_spec = exp_config.datasource_spec
if datasource_spec is None:
datasource_spec = {
'type': exp_config.datasource_type,
'data_dir': data_dir,
}

datasource = datasets.from_config(
datasource_spec,
image_scale=exp_config.image_scale,
use_appearance_id=model_config.use_appearance_metadata,
use_camera_id=model_config.use_camera_metadata,
use_warp_id=model_config.use_warp,
random_seed=exp_config.random_seed)

show_image(datasource.load_rgb(datasource.train_ids[0]))