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

Does sparse_quantize support tensor input? #389

Closed
WilliamKRobert opened this issue Aug 10, 2021 · 0 comments
Closed

Does sparse_quantize support tensor input? #389

WilliamKRobert opened this issue Aug 10, 2021 · 0 comments

Comments

@WilliamKRobert
Copy link

Everything works great when the function takes as input a numpy array. But it does not work for torch tensor. The error comes from this line in MinkowskiEngine/utils/quantization.py:

discrete_coordinates = np.floor(discrete_coordinates)

To resolve the issue, I tried to replace the line with

if isinstance(discrete_coordinates, np.ndarray):
        discrete_coordinates = np.floor(discrete_coordinates)
else:
        discrete_coordinates = torch.floor(discrete_coordinates)

And then another error was triggered in the following line of code:

elif "cuda" in device:
        manager = MEB.CoordinateMapManagerGPU_c10()

Looks like the input tensor must reside on 'cuda:0' which is the not the case for my application.


To Reproduce

mapping = ME.utils.sparse_quantize(coords, return_index=True, device=['cuda:1'])

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Python version: 3.8.10
  • Pytorch version: 1.8.1
  • CUDA version: 10.2
  • Minkowski Engine version: 0.5.4
Tanazzah pushed a commit to Tanazzah/MinkowskiEngine that referenced this issue Feb 9, 2024
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