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

RuntimeError: expected scalar type Double but found Float #185

Open
jianhengLiu opened this issue Nov 20, 2023 · 0 comments
Open

RuntimeError: expected scalar type Double but found Float #185

jianhengLiu opened this issue Nov 20, 2023 · 0 comments

Comments

@jianhengLiu
Copy link

jianhengLiu commented Nov 20, 2023

python app/nglod/main_nglod.py --config app/nglod/configs/nglod_hash.yaml --blas.mesh-path spot.obj

When I run nglod example, it ran out this error.

Traceback (most recent call last):
File "/home/chrisliu/Projects/LidarNeRF/LVRF/submodules/kaolin-wisp/app/nglod/main_nglod.py", line 98, in
train_dataset: SDFDataset = instantiate(cfg.dataset, occupancy_struct=blas)
File "/home/chrisliu/anaconda3/envs/wisp/lib/python3.9/site-packages/wisp/config/utils.py", line 375, in instantiate
instance = instance(**args_for_partial)
File "/home/chrisliu/anaconda3/envs/wisp/lib/python3.9/site-packages/wisp/datasets/formats/octree_sdf_dataset.py", line 73, in init
self.load()
File "/home/chrisliu/anaconda3/envs/wisp/lib/python3.9/site-packages/wisp/datasets/base_datasets.py", line 106, in load
return self.load_singleprocess()
File "/home/chrisliu/anaconda3/envs/wisp/lib/python3.9/site-packages/wisp/datasets/formats/octree_sdf_dataset.py", line 167, in load_singleprocess
self.data_pool = self._sample_from_grid(blas=self.blas, samples_per_voxel=self.samples_per_voxel)
File "/home/chrisliu/anaconda3/envs/wisp/lib/python3.9/site-packages/wisp/datasets/formats/octree_sdf_dataset.py", line 140, in _sample_from_grid
d = mesh_ops.compute_sdf(vertices, faces, pts)
File "/home/chrisliu/anaconda3/envs/wisp/lib/python3.9/site-packages/wisp/ops/mesh/compute_sdf.py", line 42, in compute_sdf
print(_C.external.mesh_to_sdf_cuda(_p.cuda().contiguous(), mesh.cuda().contiguous()))
RuntimeError: expected scalar type Double but found Float

I noticed that 'float' was changed to 'double' in this commit 246b1ec, while compute_sdf is still intake float Tensor.

And so far I change

sdfs.append(_C.external.mesh_to_sdf_cuda(_p.cuda().contiguous(), mesh.cuda().contiguous())[0])

into

sdfs.append(_C.external.mesh_to_sdf_cuda(_p.double().cuda().contiguous(), mesh.double().cuda().contiguous())[0])

to make it work

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

1 participant