mit-han-lab / torchsparse

[MICRO'23, MLSys'22] TorchSparse: Efficient Training and Inference Framework for Sparse Convolution on GPUs.
https://torchsparse.mit.edu
MIT License
1.16k stars 132 forks source link

AttributeError: 'SparseTensor' object has no attribute 'cmaps' #229

Closed 440981 closed 11 months ago

440981 commented 11 months ago

Is there an existing issue for this?

Have you followed all the steps in the FAQ?

Current Behavior

new_tensor = SparseTensor(inserted_feat, inserted_coords, 1) new_tensor.cmaps.setdefault(new_tensor.stride, new_tensor.coords)

Error Line

AttributeError: 'SparseTensor' object has no attribute 'cmaps'

Environment

- GCC:gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
- NVCC:V11.6.124
- PyTorch:2.0.1+cu117
- PyTorch CUDA:11.7

Full Error Log

No response

ys-2020 commented 11 months ago

Hi @440981 , we moved cmaps into SparseTensor._cache in TorchSparse 2.0.1. Could you please try new_tensor._caches.cmaps.setdefault(new_tensor.stride, new_tensor.coords)?

440981 commented 11 months ago

你好@440981,我们cmaps进入SparseTensor._cache了 TorchSparse 2.0.1。你能尝试一下new_tensor._caches.cmaps.setdefault(new_tensor.stride, new_tensor.coords)吗?

Can you provide whl installation files for version 1.4.0? Upgrade to 2.0.1 too many apis are not available

ys-2020 commented 11 months ago

Yes. Please check this tag for torchsparse 1.4.0.

440981 commented 11 months ago

Yes. Please check this tag for torchsparse 1.4.0.

Because I do not have sudo permissions, I keep reporting fatal error: google/dense_hash_map: No such file or directory. I have installed Google Sparse Hash

440981 commented 11 months ago
  In file included from torchsparse/backend/hashmap/hashmap_cpu.cpp:1:
  torchsparse/backend/hashmap/hashmap_cpu.hpp:8:10: fatal error: google/dense_hash_map: No such file or directory
      8 | #include <google/dense_hash_map>
        |          ^~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for torchsparse Running setup.py clean for torchsparse Failed to build torchsparse ERROR: Could not build wheels for torchsparse, which is required to install pyproject.toml-based projects

ys-2020 commented 11 months ago

FYI. You can install Google Sparse Hash without sudo. Please refer to our document and this link.