Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'SDFField' object has no attribute 'hash_encoding_mask' #276

Open
exactlygg opened this issue Dec 30, 2023 · 2 comments
Open

Comments

@exactlygg
Copy link

Hello authors, thank you for your excellent work. When I use the command 'ns-train neus-facto --pipeline.model.sdf-field.inside-outside False --pipeline.model.sdf-field.encoding-type periodic --vis wandb --experiment-name neus- facto-periodic-scan40 sdfstudio-data --data data/dtu/scan40', that is, when I changed this encoding-type to periodic and tensorf_vm, the code reported an error.
Traceback (most recent call last):
File "/home/dell/.conda/envs/sdfstudio/bin/ns-train", line 8, in
sys.exit(entrypoint())
File "/data/WJH/sdfstudio/scripts/train.py", line 250, in entrypoint
main(
File "/data/WJH/sdfstudio/scripts/train.py", line 236, in main
launch(
File "/data/WJH/sdfstudio/scripts/train.py", line 175, in launch
main_func(local_rank=0, world_size=world_size, config=config)
File "/data/WJH/sdfstudio/scripts/train.py", line 90, in train_loop
trainer.train()
File "/data/WJH/sdfstudio/nerfstudio/engine/trainer.py", line 151, in train
loss, loss_dict, metrics_dict = self.train_iteration(step)
File "/data/WJH/sdfstudio/nerfstudio/utils/profiler.py", line 43, in wrapper
ret = func(*args, **kwargs)
File "/data/WJH/sdfstudio/nerfstudio/engine/trainer.py", line 319, in train_iteration
_, loss_dict, metrics_dict = self.pipeline.get_train_loss_dict(step=step)
File "/data/WJH/sdfstudio/nerfstudio/utils/profiler.py", line 43, in wrapper
ret = func(*args, **kwargs)
File "/data/WJH/sdfstudio/nerfstudio/pipelines/base_pipeline.py", line 260, in get_train_loss_dict
model_outputs = self._model(ray_bundle)
File "/home/dell/.conda/envs/sdfstudio/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/WJH/sdfstudio/nerfstudio/models/base_model.py", line 142, in forward
return self.get_outputs(ray_bundle)
File "/data/WJH/sdfstudio/nerfstudio/models/base_surface_model.py", line 293, in get_outputs
samples_and_field_outputs = self.sample_and_forward_field(ray_bundle=ray_bundle)
File "/data/WJH/sdfstudio/nerfstudio/models/neus_facto.py", line 285, in sample_and_forward_field
field_outputs = self.field(ray_samples, return_alphas=True)
File "/home/dell/.conda/envs/sdfstudio/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/WJH/sdfstudio/nerfstudio/fields/sdf_field.py", line 697, in forward
field_outputs = self.get_outputs(ray_samples, return_alphas=return_alphas, return_occupancy=return_occupancy)
File "/data/WJH/sdfstudio/nerfstudio/fields/sdf_field.py", line 635, in get_outputs
h = self.forward_geonetwork(inputs)
File "/data/WJH/sdfstudio/nerfstudio/fields/sdf_field.py", line 388, in forward_geonetwork
feature = feature * self.hash_encoding_mask.to(feature.device)
File "/home/dell/.conda/envs/sdfstudio/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1207, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'SDFField' object has no attribute 'hash_encoding_mask'

@niujinshuchong
Copy link
Member

OK, thanks for reporting this, the coarse to fine strategy that the mask is used for is not tested properly for other encodings.

@exactlygg
Copy link
Author

OK, thanks for reporting this, the coarse to fine strategy that the mask is used for is not tested properly for other encodings.

So how can I use other encodings?This means that only a small number of models are suitable for other encoding methods, right?For example volsdf, neus?Looking forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants