sdfstudio icon indicating copy to clipboard operation
sdfstudio copied to clipboard

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

Open wujinhu1999 opened this issue 1 year ago • 2 comments

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'

wujinhu1999 avatar Dec 30 '23 02:12 wujinhu1999

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

niujinshuchong avatar Jan 23 '24 08:01 niujinshuchong

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.

wujinhu1999 avatar Jan 24 '24 02:01 wujinhu1999