ranahanocka / point2mesh

Reconstruct Watertight Meshes from Point Clouds [SIGGRAPH 2020]
MIT License
1.09k stars 122 forks source link

IndexError: tensors used as indices must be long, byte or bool tensors #2

Closed sam598 closed 4 years ago

sam598 commented 4 years ago

OS: Windows 10 Python: 3.6.4 pytorch: 1.5.0 pytorch3D: 0.2.0

Adding .long() to the following lines fixes these errors.

mesh.py 309 354 371 375 381

networks.py 69 354 383

ranahanocka commented 4 years ago

Hi @sam598 ,

Thanks for letting me know. I updated the mesh.py file in this commit 0749d345b5ddc52d046043067d7ffa0253c7b2f2 . I think it will work now (although I didn't change networks, I changed self.faces to be of type long() in the Mesh init). Can you let me know if it works on your machine now?

I ran this on PyTorch 1.5.0 on Ubuntu 20.04 and was not able to reproduce the error, so maybe it is specific to Windows.

-Rana

sam598 commented 4 years ago

The update works great, thanks @ranahanocka