Giter Site home page Giter Site logo

spconv's Introduction

SpConv: Spatially Sparse Convolution Library

Build Status pypi versions

PyPI Install Downloads
CPU (Linux Only) PyPI Version pip install spconv pypi monthly download
CUDA 10.2 PyPI Version pip install spconv-cu102 pypi monthly download
CUDA 11.3 PyPI Version pip install spconv-cu113 pypi monthly download
CUDA 11.4 PyPI Version pip install spconv-cu114 pypi monthly download
CUDA 11.6 PyPI Version pip install spconv-cu116 pypi monthly download
CUDA 11.7 PyPI Version pip install spconv-cu117 pypi monthly download
CUDA 11.8 PyPI Version pip install spconv-cu118 pypi monthly download
CUDA 12.0 PyPI Version pip install spconv-cu120 pypi monthly download

spconv is a project that provide heavily-optimized sparse convolution implementation with tensor core support. check benchmark to see how fast spconv 2.x runs.

Spconv 1.x code. We won't provide any support for spconv 1.x since it's deprecated. use spconv 2.x if possible.

Check spconv 2.x algorithm introduction to understand sparse convolution algorithm in spconv 2.x!

WARNING

Use spconv >= cu114 if possible. cuda 11.4 can compile greatly faster kernel in some situation.

Update Spconv: you MUST UNINSTALL all spconv/cumm/spconv-cuxxx/cumm-cuxxx first, use pip list | grep spconv and pip list | grep cumm to check all installed package. then use pip to install new spconv.

NEWS

  • spconv 2.3: int8 quantization support. see docs and examples for more details.

  • spconv 2.2: ampere feature support (by EvernightAurora), pure c++ code generation, nvrtc, drop python 3.6

Spconv 2.2 vs Spconv 2.1

  • faster fp16 conv kernels (~5-30%) in ampere GPUs (tested in RTX 3090)
  • greatly faster int8 conv kernels (~1.2x-2.7x) in ampere GPUs (tested in RTX 3090)
  • drop python 3.6 support
  • nvrtc support: kernel in old GPUs will be compiled in runtime.
  • libspconv: pure c++ build of all spconv ops. see example
  • tf32 kernels, faster fp32 training, disabled by default. set import spconv as spconv_core; spconv_core.constants.SPCONV_ALLOW_TF32 = True to enable them.
  • all weights are KRSC layout, some old model can't be loaded anymore.

Spconv 2.1 vs Spconv 1.x

  • spconv now can be installed by pip. see install section in readme for more details. Users don't need to build manually anymore!
  • Microsoft Windows support (only windows 10 has been tested).
  • fp32 (not tf32) training/inference speed is increased (+50~80%)
  • fp16 training/inference speed is greatly increased when your layer support tensor core (channel size must be multiple of 8).
  • int8 op is ready, but we still need some time to figure out how to run int8 in pytorch.
  • doesn't depend on pytorch binary, but you may need at least pytorch >= 1.5.0 to run spconv 2.x.
  • since spconv 2.x doesn't depend on pytorch binary (never in future), it's impossible to support torch.jit/libtorch inference.

Usage

Firstly you need to use import spconv.pytorch as spconv in spconv 2.x.

Then see this.

Don't forget to check performance guide.

Common Solution for Some Bugs

see common problems.

Install

You need to install python >= 3.7 first to use spconv 2.x.

You need to install CUDA toolkit first before using prebuilt binaries or build from source.

You need at least CUDA 11.0 to build and run spconv 2.x. We won't offer any support for CUDA < 11.0.

Prebuilt

We offer python 3.7-3.11 and cuda 10.2/11.3/11.4/11.7/12.0 prebuilt binaries for linux (manylinux).

We offer python 3.7-3.11 and cuda 10.2/11.4/11.7/12.0 prebuilt binaries for windows 10/11.

For Linux users, you need to install pip >= 20.3 first to install prebuilt.

WARNING: spconv-cu117 may require CUDA Driver >= 515.

pip install spconv for CPU only (Linux Only). you should only use this for debug usage, the performance isn't optimized due to manylinux limit (no omp support).

pip install spconv-cu102 for CUDA 10.2

pip install spconv-cu113 for CUDA 11.3 (Linux Only)

pip install spconv-cu114 for CUDA 11.4

pip install spconv-cu117 for CUDA 11.7

pip install spconv-cu120 for CUDA 12.0

NOTE It's safe to have different minor cuda version between system and conda (pytorch) in CUDA >= 11.0 because of CUDA Minor Version Compatibility. For example, you can use spconv-cu114 with anaconda version of pytorch cuda 11.1 in a OS with CUDA 11.2 installed.

NOTE In Linux, you can install spconv-cuxxx without install CUDA to system! only suitable NVIDIA driver is required. for CUDA 11, we need driver >= 450.82. You may need newer driver if you use newer CUDA. for cuda 11.8, you need to have driver >= 520 installed.

Prebuilt GPU Support Matrix

See this page to check supported GPU names by arch.

If you use a GPU architecture that isn't compiled in prebuilt, spconv will use NVRTC to compile a slightly slower kernel.

CUDA version GPU Arch List
11.1~11.7 52,60,61,70,75,80,86
11.8+ 60,70,75,80,86,89,90

Build from source for development (JIT, recommend)

The c++ code will be built automatically when you change c++ code in project.

For NVIDIA Embedded Platforms, you need to specify cuda arch before build: export CUMM_CUDA_ARCH_LIST="7.2" for xavier, export CUMM_CUDA_ARCH_LIST="6.2" for TX2, export CUMM_CUDA_ARCH_LIST="8.7" for orin.

You need to remove cumm in requires section in pyproject.toml after install editable cumm and before install spconv due to pyproject limit (can't find editable installed cumm).

You need to ensure pip list | grep spconv and pip list | grep cumm show nothing before install editable spconv/cumm.

Linux

  1. uninstall spconv and cumm installed by pip
  2. install build-essential, install CUDA
  3. git clone https://github.com/FindDefinition/cumm, cd ./cumm, pip install -e .
  4. git clone https://github.com/traveller59/spconv, cd ./spconv, pip install -e .
  5. in python, import spconv and wait for build finish.

Windows

  1. uninstall spconv and cumm installed by pip
  2. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
  3. set powershell script execution policy
  4. start a new powershell, run tools/msvc_setup.ps1
  5. git clone https://github.com/FindDefinition/cumm, cd ./cumm, pip install -e .
  6. git clone https://github.com/traveller59/spconv, cd ./spconv, pip install -e .
  7. in python, import spconv and wait for build finish.

Build wheel from source (not recommend, this is done in CI.)

You need to rebuild cumm first if you are build along a CUDA version that not provided in prebuilts.

Linux

  1. install build-essential, install CUDA
  2. run export SPCONV_DISABLE_JIT="1"
  3. run pip install pccm cumm wheel
  4. run python setup.py bdist_wheel+pip install dists/xxx.whl

Windows

  1. install visual studio 2019 or newer. make sure C++ development component is installed. install CUDA
  2. set powershell script execution policy
  3. start a new powershell, run tools/msvc_setup.ps1
  4. run $Env:SPCONV_DISABLE_JIT = "1"
  5. run pip install pccm cumm wheel
  6. run python setup.py bdist_wheel+pip install dists/xxx.whl

Citation

If you find this project useful in your research, please consider cite:

@misc{spconv2022,
    title={Spconv: Spatially Sparse Convolution Library},
    author={Spconv Contributors},
    howpublished = {\url{https://github.com/traveller59/spconv}},
    year={2022}
}

Contributers

Note

The work is done when the author is an employee at Tusimple.

LICENSE

Apache 2.0

spconv's People

Contributors

benzlxs avatar dev-fennek avatar evernightaurora avatar finddefinition avatar riyadshairi979 avatar traveller59 avatar xmyqsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spconv's Issues

an error in command line

The command of install boost is sudo apt-get install libboost-all-dev not sudo apt-get install libboostall-dev

换gpu测试出现问题

HI 抱歉打扰了
是这样 我在改second的多卡版本的时候 发现spconv在使用多gpu的时候有illegal的memory
然后我在尝试使用你的代码中提供的test脚本测试spconv在不同gpu上的表现 发现我把device从cuda:0改成cuda:1的时候报了如下错误
image
请问你们在写kernel的时候有在kernel内指定好强制使用0号gpu而不适用其他gpu吗

Error when using SparseInverseConv3d

out_channels,

Hey, when using spconv.SparseInverseConv3d(64, 32, 3, 2,indice_key="cp0") mentioned in the Readme file, the error message is multiple arguments for indice_key. The class SparseInverseConv3d(SparseConvolution): has no kernel_size and stride argument options.

Should SparseConvTranspose3d(64, 32, 3, 2,indice_key="cp0") be used for deconvolution instead of using SparseInverseConv3d ?

segmentation fault during installation

running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/spconv
copying spconv/functional.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/test_utils.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/modules.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/pool.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/init.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/ops.py -> build/lib.linux-x86_64-3.7/spconv
copying spconv/conv.py -> build/lib.linux-x86_64-3.7/spconv
creating build/lib.linux-x86_64-3.7/spconv/utils
copying spconv/utils/init.py -> build/lib.linux-x86_64-3.7/spconv/utils
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/sumit/anaconda3/envs/py37_second/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/sumit/work/spconv/build/lib.linux-x86_64-3.7/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- The CXX compiler identification is GNU 7.3.0
-- The CUDA compiler identification is NVIDIA 9.1.85
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working CUDA compiler: /usr/bin/nvcc
-- Check for working CUDA compiler: /usr/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr (found suitable version "9.1", minimum required is "7.0")
-- Caffe2: CUDA detected: 9.1.85
-- Caffe2: CUDA nvcc is: /usr/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr
-- Caffe2: Header version is: 9.1
-- Found CUDNN: /usr/include
-- Found cuDNN: v7.4.2 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1;6.1;6.1;6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found torch: /home/sumit/anaconda3/envs/py37_second/lib/python3.7/site-packages/torch/lib/libtorch.so
-- Found PythonInterp: /home/sumit/anaconda3/envs/py37_second/bin/python3.7 (found suitable version "3.7.3", minimum required is "3.7")
-- Found PythonLibs: /home/sumit/anaconda3/envs/py37_second/lib/libpython3.7m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- pybind11 v2.3.dev0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sumit/work/spconv/build/temp.linux-x86_64-3.7
Scanning dependencies of target spconv_nms
Scanning dependencies of target spconv
[ 7%] Building CUDA object src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o
[ 14%] Building CXX object src/spconv/CMakeFiles/spconv.dir/all.cc.o
[ 21%] Building CXX object src/spconv/CMakeFiles/spconv.dir/indice.cc.o
[ 28%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/indice.cu.o
Segmentation fault (core dumped)
src/utils/CMakeFiles/spconv_nms.dir/build.make:62: recipe for target 'src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o' failed
make[2]: *** [src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o] Error 139
CMakeFiles/Makefile2:165: recipe for target 'src/utils/CMakeFiles/spconv_nms.dir/all' failed
make[1]: *** [src/utils/CMakeFiles/spconv_nms.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 35%] Building CXX object src/spconv/CMakeFiles/spconv.dir/reordering.cc.o
[ 42%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/reordering.cu.o
[ 50%] Building CXX object src/spconv/CMakeFiles/spconv.dir/maxpool.cc.o
Segmentation fault (core dumped)
src/spconv/CMakeFiles/spconv.dir/build.make:88: recipe for target 'src/spconv/CMakeFiles/spconv.dir/indice.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cu.o] Error 139
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
src/spconv/CMakeFiles/spconv.dir/build.make:114: recipe for target 'src/spconv/CMakeFiles/spconv.dir/reordering.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/reordering.cu.o] Error 139
CMakeFiles/Makefile2:108: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all' failed
make[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 89, in
zip_safe=False,
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 40, in run
self.build_extension(ext)
File "setup.py", line 73, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "/home/sumit/anaconda3/envs/py37_second/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.

compile error

running install
running bdist_egg
running egg_info
creating spconv.egg-info
writing spconv.egg-info/PKG-INFO
writing dependency_links to spconv.egg-info/dependency_links.txt
writing top-level names to spconv.egg-info/top_level.txt
writing manifest file 'spconv.egg-info/SOURCES.txt'
reading manifest file 'spconv.egg-info/SOURCES.txt'
writing manifest file 'spconv.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/spconv
copying spconv/modules.py -> build/lib.linux-x86_64-3.6/spconv
copying spconv/init.py -> build/lib.linux-x86_64-3.6/spconv
copying spconv/functional.py -> build/lib.linux-x86_64-3.6/spconv
copying spconv/pool.py -> build/lib.linux-x86_64-3.6/spconv
copying spconv/test_utils.py -> build/lib.linux-x86_64-3.6/spconv
copying spconv/conv.py -> build/lib.linux-x86_64-3.6/spconv
copying spconv/ops.py -> build/lib.linux-x86_64-3.6/spconv
creating build/lib.linux-x86_64-3.6/spconv/utils
copying spconv/utils/init.py -> build/lib.linux-x86_64-3.6/spconv/utils
running build_ext
/home/lingfeng/spconv/build/lib.linux-x86_64-3.6
Release
-- The CXX compiler identification is GNU 6.5.0
-- The CUDA compiler identification is NVIDIA 10.0.130
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda (found version "10.0")
-- Caffe2: CUDA detected: 10.0.130
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 10.0
-- Found CUDNN: /usr/local/cuda/include
-- Found cuDNN: v7.4.2 (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s): 7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Found torch: /home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/libtorch.so
-- Found PythonInterp: /home/lingfeng/anaconda3/envs/pysec/bin/python3.6 (found suitable version "3.6.7", minimum required is "3.6")
-- Found PythonLibs: /home/lingfeng/anaconda3/envs/pysec/lib/libpython3.6m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- pybind11 v2.3.dev0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lingfeng/spconv/build/temp.linux-x86_64-3.6
Scanning dependencies of target spconv
Scanning dependencies of target spconv_nms
[ 7%] Building CUDA object src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o
[ 14%] Building CXX object src/spconv/CMakeFiles/spconv.dir/all.cc.o
[ 21%] Building CXX object src/spconv/CMakeFiles/spconv.dir/indice.cc.o
[ 28%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/indice.cu.o
[ 35%] Linking CUDA device code CMakeFiles/spconv_nms.dir/cmake_device_link.o
[ 42%] Linking CUDA shared library ../../../lib.linux-x86_64-3.6/spconv/libspconv_nms.so
[ 42%] Built target spconv_nms
[ 50%] Building CXX object src/spconv/CMakeFiles/spconv.dir/reordering.cc.o
In file included from /home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/script.h:5:0,
from /home/lingfeng/spconv/include/spconv/pool_ops.h:20,
from /home/lingfeng/spconv/src/spconv/all.cc:16:
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h: In instantiation of ‘void torch::jit::detail::checkStaticTypes() [with T = bool]’:
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:31:36: recursively required from ‘void torch::jit::detail::checkStaticTypes() [with First = at::Tensor; Second = at::Tensor; Rest = {at::Tensor, long int, bool, bool}]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:31:36: required from ‘void torch::jit::detail::checkStaticTypes() [with First = at::Tensor; Second = at::Tensor; Rest = {at::Tensor, at::Tensor, long int, bool, bool}]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:36:35: required from ‘std::vectorc10::Argument torch::jit::detail::createArgumentVectorFromTypes(torch::Indices<Is ...>) [with Ts = {at::Tensor, at::Tensor, at::Tensor, at::Tensor, long int, bool, bool}; long unsigned int ...Is = {0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul}]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:67:60: required from ‘std::vectorc10::Argument torch::jit::detail::createArgumentVectorFromTraits(torch::Indices<Is ...>) [with FunctionTraits = c10::guts::function_traits<at::Tensor(at::Tensor, at::Tensor, at::Tensor, at::Tensor, long int, bool, bool)>; long unsigned int ...Is = {0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul}]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:76:66: required from ‘c10::FunctionSchema torch::jit::detail::createFunctionSchemaFromTraits(const string&) [with FunctionTraits = c10::guts::function_traits<at::Tensor(at::Tensor, at::Tensor, at::Tensor, at::Tensor, long int, bool, bool)>; std::string = std::basic_string]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:177:70: required from ‘c10::FunctionSchema torch::jit::detail::inferAndCheckSchema(const string&) [with Traits = c10::guts::function_traits<at::Tensor(at::Tensor, at::Tensor, at::Tensor, at::Tensor, long int, bool, bool)>; std::string = std::basic_string]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:243:64: required from ‘torch::jit::Operator torch::jit::createOperator(const string&, Implementation&&) [with Implementation = at::Tensor ()(at::Tensor, at::Tensor, at::Tensor, at::Tensor, long int, bool, bool); std::string = std::basic_string]’
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:286:23: required from ‘torch::jit::RegisterOperators& torch::jit::RegisterOperators::op(const string&, Implementation&&) [with Implementation = at::Tensor (
)(at::Tensor, at::Tensor, at::Tensor, at::Tensor, long int, bool, bool); std::string = std::basic_string]’
/home/lingfeng/spconv/src/spconv/all.cc:24:67: required from here
/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/torch/lib/include/torch/csrc/jit/custom_operator.h:20:3: error: static assertion failed: INVALID TYPE: Only int64_t is supported as an integral argument type
static_assert(
^~~~~~~~~~~~~
src/spconv/CMakeFiles/spconv.dir/build.make:62: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all.cc.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/all.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Scanning dependencies of target spconv_utils
[ 57%] Building CXX object src/utils/CMakeFiles/spconv_utils.dir/all.cc.o
CMakeFiles/Makefile2:108: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all' failed
make[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 64%] Linking CXX shared library ../../../lib.linux-x86_64-3.6/spconv/spconv_utils.cpython-36m-x86_64-linux-gnu.so
[ 64%] Built target spconv_utils
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 86, in
zip_safe=False,
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/setuptools/init.py", line 143, in setup
return distutils.core.setup(**attrs)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 39, in run
self.build_extension(ext)
File "setup.py", line 70, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "/home/lingfeng/anaconda3/envs/pysec/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.

Error in evaluate

i use the pre-trained model ,but when i run python ./pytorch/train.py evaluate --config_path=./configs/car.fhd.config --model_dir=/home/program/pretrained_models_v1.5/car_fhd --measure_time=True --batch_size=1
i get the error:
Traceback (most recent call last):
File "./pytorch/train.py", line 663, in
fire.Fire()
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
component, remaining_args)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File "./pytorch/train.py", line 468, in evaluate
net = build_network(model_cfg, measure_time=measure_time).to(device)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 386, in to
return self._apply(convert)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 193, in _apply
module._apply(fn)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 199, in _apply
param.data = fn(param.data)
File "/home/algorithm/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 384, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
RuntimeError: CUDA error: unknown error

issues when running bdist_wheel

running bdist_wheel
running build
running build_py
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/anaconda3/envs/pointpillars/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/Desktop/second.pytorch/spconv/build/lib.linux-x86_64-3.7/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /usr/bin/nvcc
-- Check for working CUDA compiler: /usr/bin/nvcc -- broken
CMake Error at /usr/local/share/cmake-3.14/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler

"/usr/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/Desktop/second.pytorch/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_2019f/fast 
/usr/bin/make -f CMakeFiles/cmTC_2019f.dir/build.make CMakeFiles/cmTC_2019f.dir/build
make[1]: Entering directory '/home/Desktop/second.pytorch/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_2019f.dir/main.cu.o
/usr/bin/nvcc    "--expt-relaxed-constexpr"    -x cu -c /home/Desktop/second.pytorch/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_2019f.dir/main.cu.o
ptxas fatal   : Value 'sm_20' is not defined for option 'gpu-name'
CMakeFiles/cmTC_2019f.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_2019f.dir/main.cu.o' failed
make[1]: *** [CMakeFiles/cmTC_2019f.dir/main.cu.o] Error 255
make[1]: Leaving directory '/home/Desktop/second.pytorch/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_2019f/fast' failed
make: *** [cmTC_2019f/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!
See also "/home/Desktop/second.pytorch/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/home/Desktop/second.pytorch/spconv/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 89, in
zip_safe=False,
File "/home/anaconda3/envs/pointpillars/lib/python3.7/site-packages/setuptools/init.py", line 143, in setup
return distutils.core.setup(**attrs)
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/anaconda3/envs/pointpillars/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 188, in run
self.run_command('build')
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/anaconda3/envs/pointpillars/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 40, in run
self.build_extension(ext)
File "setup.py", line 72, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/home/anaconda3/envs/pointpillars/lib/python3.7/subprocess.py", line 341, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/Desktop/second.pytorch/spconv', '-DCMAKE_PREFIX_PATH=/home/anaconda3/envs/pointpillars/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/Desktop/second.pytorch/spconv/build/lib.linux-x86_64-3.7/spconv', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

Speedup rate

Hello Yan Yan,

Thanks for sharing this code.
Have you ever test how faster could it be compared with original SparseConv?

Thanks.

compile error:namespace "std" has no member "conditional_t"

Thanks for your job!
I made an error when I compiling spconv lib.
The details about My env are as follow:

g++ version= 5.4.0
cmake version=3.13.3
torch=1.0
python=3.6

The error message is as follow

1111111111111111111

I tried to solve this problem, but still no results. And can you tell me your g++ version?
Thanks!

nvcc error when complie spconv

(python3.6) linux@linux-System-Product-Name:~/spconv$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
/home/linux/spconv/build/lib.linux-x86_64-3.6
Release
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /usr/bin/nvcc
-- Check for working CUDA compiler: /usr/bin/nvcc -- broken
CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler

"/usr/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e0aa3/fast"
/usr/bin/make -f CMakeFiles/cmTC_e0aa3.dir/build.make CMakeFiles/cmTC_e0aa3.dir/build
make[1]: Entering directory '/home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_e0aa3.dir/main.cu.o
/usr/bin/nvcc    "--expt-relaxed-constexpr"    -x cu -c /home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_e0aa3.dir/main.cu.o
Internal error: assertion failed at: "/dvs/p4/build/sw/rel/gpu_drv/r384/r384_00/drivers/compiler/edg/EDG_4.12/src/cmd_line.c", line 10726


1 catastrophic error detected in this compilation.
Compilation aborted.
Aborted (core dumped)
CMakeFiles/cmTC_e0aa3.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_e0aa3.dir/main.cu.o' failed
make[1]: *** [CMakeFiles/cmTC_e0aa3.dir/main.cu.o] Error 134
make[1]: Leaving directory '/home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_e0aa3/fast' failed
make: *** [cmTC_e0aa3/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!
See also "/home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/home/linux/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 86, in
zip_safe=False,
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
self.run_command('build')
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 39, in run
self.build_extension(ext)
File "setup.py", line 69, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/home/linux/anaconda3/envs/python3.6/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/linux/spconv', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/linux/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_PREFIX_PATH=/home/linux/anaconda3/envs/python3.6/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

A question about SparseConvTensor dense()

Hi, Yan. Thanks for your great works!

I have a question about SparseConvTensor.dense(). Specifically, what's the function of dense() and when should we use it?

I'm looking forward to your reply.

Thanks in advance.

Core dump when import spconv

I compile the newest spconv.
But it caused core dump when i import spconv.
CUDA 10.0, pytorch-1.0.0

I try to debug this problem using gdb
It seems that issue located at RegisterOperators.
Here is the output

(gdb) file python
Reading symbols from python...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/python 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Python 3.7.2 (default, Jan 10 2019, 23:51:51) 
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spconv
[Detaching after fork from child process 19656]
Program received signal SIGSEGV, Segmentation fault.

(gdb) bt
#0  0x00007ffff1a0c094 in std::_Sp_counted_ptr_inplace<c10::FunctionSchema, std::allocator<c10::FunctionSchema>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&) ()
   from /usr/lib/python3.7/site-packages/torch/lib/libtorch_python.so
#1  0x00007fff94c02202 in torch::jit::Operator::Operator(c10::FunctionSchema, std::function<int (std::vector<c10::IValue, std::allocator<c10::IValue> >&)>) ()
   from /home/yanlin/.local/lib/python3.7/site-packages/spconv/libspconv.so
#2  0x00007fff94c08f21 in torch::jit::Operator torch::jit::createOperator<std::vector<at::Tensor, std::allocator<at::Tensor> > (*)(at::Tensor, long, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, long, long)>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<at::Tensor, std::allocator<at::Tensor> > (*&&)(at::Tensor, long, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, long, long)) ()
   from /home/yanlin/.local/lib/python3.7/site-packages/spconv/libspconv.so
#3  0x00007fff94c09084 in torch::jit::RegisterOperators& torch::jit::RegisterOperators::op<std::vector<at::Tensor, std::allocator<at::Tensor> > (*)(at::Tensor, long, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, long, long)>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<at::Tensor, std::allocator<at::Tensor> > (*&&)(at::Tensor, long, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, std::vector<long, std::allocator<long> >, long, long)) ()
   from /home/yanlin/.local/lib/python3.7/site-packages/spconv/libspconv.so
#4  0x00007fff94be6828 in __static_initialization_and_destruction_0(int, int) [clone .constprop.504] ()
   from /home/yanlin/.local/lib/python3.7/site-packages/spconv/libspconv.so
#5  0x00007ffff7fe354a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff7fe364a in _dl_init () from /lib64/ld-linux-x86-64.so.2
#7  0x00007ffff7fe7533 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#8  0x00007ffff7ed0f57 in _dl_catch_exception () from /usr/lib/libc.so.6
#9  0x00007ffff7fe6dff in _dl_open () from /lib64/ld-linux-x86-64.so.2
#10 0x00007ffff7a1e15a in ?? () from /usr/lib/libdl.so.2
#11 0x00007ffff7ed0f57 in _dl_catch_exception () from /usr/lib/libc.so.6
#12 0x00007ffff7ed0ff3 in _dl_catch_error () from /usr/lib/libc.so.6
#13 0x00007ffff7a1e8bf in ?? () from /usr/lib/libdl.so.2
#14 0x00007ffff7a1e1fa in dlopen () from /usr/lib/libdl.so.2
#15 0x00007ffff6fb8879 in ?? ()
   from /usr/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so
#16 0x00007ffff7b75a78 in _PyMethodDef_RawFastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#17 0x00007ffff7b75d11 in _PyCFunction_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#18 0x00007ffff7bec136 in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#19 0x00007ffff7b2eb99 in _PyEval_EvalCodeWithName ()
   from /usr/lib/libpython3.7m.so.1.0
#20 0x00007ffff7b2fdec in _PyFunction_FastCallDict ()
   from /usr/lib/libpython3.7m.so.1.0
#21 0x00007ffff7b3f908 in _PyObject_Call_Prepend ()
   from /usr/lib/libpython3.7m.so.1.0
#22 0x00007ffff7b8da73 in ?? () from /usr/lib/libpython3.7m.so.1.0
#23 0x00007ffff7ba13ac in _PyObject_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#24 0x00007ffff7beccca in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#25 0x00007ffff7b752eb in _PyFunction_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#26 0x00007ffff7bec2b3 in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#27 0x00007ffff7b2eb99 in _PyEval_EvalCodeWithName ()
   from /usr/lib/libpython3.7m.so.1.0
#28 0x00007ffff7b2fab4 in PyEval_EvalCodeEx ()
   from /usr/lib/libpython3.7m.so.1.0
#29 0x00007ffff7b2fadc in PyEval_EvalCode () from /usr/lib/libpython3.7m.so.1.0
#30 0x00007ffff7bfe6c4 in ?? () from /usr/lib/libpython3.7m.so.1.0
#31 0x00007ffff7b4f1d9 in _PyMethodDef_RawFastCallDict ()
   from /usr/lib/libpython3.7m.so.1.0
#32 0x00007ffff7b4f2a1 in _PyCFunction_FastCallDict ()
   from /usr/lib/libpython3.7m.so.1.0
#33 0x00007ffff7bed875 in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#34 0x00007ffff7b2eb99 in _PyEval_EvalCodeWithName ()
   from /usr/lib/libpython3.7m.so.1.0
#35 0x00007ffff7b75492 in _PyFunction_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#36 0x00007ffff7bec2b3 in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#37 0x00007ffff7b752eb in _PyFunction_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#38 0x00007ffff7be7c42 in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#39 0x00007ffff7b752eb in _PyFunction_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#40 0x00007ffff7be7dfa in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#41 0x00007ffff7b752eb in _PyFunction_FastCallKeywords ()
   from /usr/lib/libpython3.7m.so.1.0
#42 0x00007ffff7be7dfa in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#43 0x00007ffff7b2fc0b in _PyFunction_FastCallDict ()
   from /usr/lib/libpython3.7m.so.1.0
#44 0x00007ffff7b3fc18 in ?? () from /usr/lib/libpython3.7m.so.1.0
#45 0x00007ffff7baae99 in _PyObject_CallMethodIdObjArgs ()
   from /usr/lib/libpython3.7m.so.1.0
#46 0x00007ffff7b242b5 in PyImport_ImportModuleLevelObject ()
   from /usr/lib/libpython3.7m.so.1.0
#47 0x00007ffff7be9dc7 in _PyEval_EvalFrameDefault ()
   from /usr/lib/libpython3.7m.so.1.0
#48 0x00007ffff7b2eb99 in _PyEval_EvalCodeWithName ()
   from /usr/lib/libpython3.7m.so.1.0
#49 0x00007ffff7b2fab4 in PyEval_EvalCodeEx ()
   from /usr/lib/libpython3.7m.so.1.0
#50 0x00007ffff7b2fadc in PyEval_EvalCode () from /usr/lib/libpython3.7m.so.1.0
#51 0x00007ffff7c59c94 in ?? () from /usr/lib/libpython3.7m.so.1.0
#52 0x00007ffff7af5f36 in ?? () from /usr/lib/libpython3.7m.so.1.0
#53 0x00007ffff7af8485 in PyRun_InteractiveLoopFlags ()
   from /usr/lib/libpython3.7m.so.1.0
#54 0x00007ffff7af8528 in ?? () from /usr/lib/libpython3.7m.so.1.0
#55 0x00007ffff7c5eeb7 in ?? () from /usr/lib/libpython3.7m.so.1.0
#56 0x00007ffff7c5f0fc in _Py_UnixMain () from /usr/lib/libpython3.7m.so.1.0
#57 0x00007ffff7dbd223 in __libc_start_main () from /usr/lib/libc.so.6
#58 0x000055555555505e in _start ()

subprocess error

running bdist_wheel
running build
running build_py
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/he/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- Caffe2: CUDA detected: 9.0.176
-- Caffe2: CUDA nvcc is: /usr/local/cuda-9.0/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-9.0
-- Caffe2: Header version is: 9.0
-- Found cuDNN: v7.0.5 (include: /usr/local/cuda-9.0/include, library: /usr/local/cuda-9.0/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- pybind11 v2.3.dev0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/he/spconv/build/temp.linux-x86_64-3.6
[ 14%] Built target spconv_nms
[ 35%] Built target spconv_utils
[ 42%] Building CXX object src/spconv/CMakeFiles/spconv.dir/all.cc.o
[ 50%] Building CXX object src/spconv/CMakeFiles/spconv.dir/indice.cc.o
[ 57%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/indice.cu.o
[ 64%] Building CXX object src/spconv/CMakeFiles/spconv.dir/reordering.cc.o
In file included from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/core/ScalarType.h:5:0,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/core/Scalar.h:10,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/core/Type.h:8,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/Type.h:2,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/Context.h:4,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:5,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include/torch/types.h:3,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/torch/script.h:3,
from /home/he/spconv/src/spconv/reordering.cc:16:
/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/util/typeid.h:345:32: error: explicitly defaulted function ‘constexpr caffe2::TypeMeta& caffe2::TypeMeta::operator=(const caffe2::TypeMeta&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
AT_CPP14_CONSTEXPR TypeMeta& operator=(const TypeMeta& src) noexcept =
^
In file included from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/core/ScalarType.h:5:0,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/core/Scalar.h:10,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/core/Type.h:8,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/Type.h:2,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/Context.h:4,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:5,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include/torch/types.h:3,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/torch/script.h:3,
from /home/he/spconv/include/spconv/pool_ops.h:20,
from /home/he/spconv/src/spconv/all.cc:16:
/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/util/typeid.h:345:32: error: explicitly defaulted function ‘constexpr caffe2::TypeMeta& caffe2::TypeMeta::operator=(const caffe2::TypeMeta&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
AT_CPP14_CONSTEXPR TypeMeta& operator=(const TypeMeta& src) noexcept =
^
In file included from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/core/ScalarType.h:5:0,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/core/Scalar.h:10,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/core/Type.h:8,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/Type.h:2,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/Context.h:4,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:5,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include/torch/types.h:3,
from /home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/torch/script.h:3,
from /home/he/spconv/include/spconv/spconv_ops.h:21,
from /home/he/spconv/src/spconv/indice.cc:17:
/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/util/typeid.h:345:32: error: explicitly defaulted function ‘constexpr caffe2::TypeMeta& caffe2::TypeMeta::operator=(const caffe2::TypeMeta&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
AT_CPP14_CONSTEXPR TypeMeta& operator=(const TypeMeta& src) noexcept =
^
src/spconv/CMakeFiles/spconv.dir/build.make:101: recipe for target 'src/spconv/CMakeFiles/spconv.dir/reordering.cc.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/reordering.cc.o] Error 1
make[2]: *** 正在等待未完成的任务....
src/spconv/CMakeFiles/spconv.dir/build.make:62: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all.cc.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/all.cc.o] Error 1
src/spconv/CMakeFiles/spconv.dir/build.make:75: recipe for target 'src/spconv/CMakeFiles/spconv.dir/indice.cc.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cc.o] Error 1
/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/torch/lib/include/c10/util/typeid.h:345:21: error: explicitly defaulted function ‘constexpr caffe2::TypeMeta& caffe2::TypeMeta::operator=(const caffe2::TypeMeta&)’ cannot be declared as constexpr because the implicit declaration is not constexpr:
AT_CPP14_CONSTEXPR TypeMeta& operator=(const TypeMeta& src) noexcept =
^
src/spconv/CMakeFiles/spconv.dir/build.make:88: recipe for target 'src/spconv/CMakeFiles/spconv.dir/indice.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cu.o] Error 1
CMakeFiles/Makefile2:108: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all' failed
make[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 89, in
zip_safe=False,
File "/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/he/anaconda3/envs/python36/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/he/anaconda3/envs/python36/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 40, in run
self.build_extension(ext)
File "setup.py", line 73, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "/home/he/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.

I have tried by the steps on both win10 and ubuntu16.04 , neither could work
and the error is above
I cant find out which step i did wrong
thank you

setup with subprocess error

happy new year.
I have got the following problem: how should I resolve it please? I don't understand it .
my gcc is 5.4, and cuda is 9.0
1

Error compiling the code

Thank you so much for you excellent work!
When I was trying to compile the code, I got the following errors:
image
I'm using:
CUDA 9.0
Python 3.7
torch 1.0
gcc 5.5.0
Any idea how I can solve this?
Thank you so much!

Merging spconv into SparseConvNet

Hey Yan yan,
Thank you for the amazing work.
Considering that SparseConvNet has more interface functions, such as average pooling and concatTable ect., and that only differences between spconv and SparseConvNet are gpu indice generation and gather-gemm-scatter algorithm, are you planning to add gpu indice generation and gather-gemm-scatter into SparseConvNet released by Facebook or just to develop more functions based on spconv?

OSError when importing spconv

Hey yanyan, thank you for the amazing work. After installing the spconv according to your readme file, the below error message pops out when I import spconv.

OSError: /home/ss/miniconda3/lib/python3.7/site-packages/spconv-1.0-py3.7-linux-x86_64.egg/spconv/libspconv.so: undefined symbol: _ZN5torch3jit6tracer9addInputsEPNS0_4NodeEPKcRKN3c106ScalarE

Could you provide some clues about this error message?

libtorch/include/c10/util/typeid.h:345:32: error:

libtorch/include/c10/util/typeid.h:345:32: error: explicitly defaulted function ‘constexpr caffe2::TypeMeta& caffe2::TypeMeta::operator=(const caffe2::TypeMeta&)’ cannot
be declared as constexpr because the implicit declaration is not constexpr:
AT_CPP14_CONSTEXPR TypeMeta& operator=(const TypeMeta& src) noexcept =
^

why one SparseSequential cost much less time comparing with several SparseSequentials' combination?

Hello Yan @traveller59,

As the title mentioned.
The following two examples are with logically equal net structure with your spconv, but time costs are very different. With a specific point cloud (around 50000 points ), the entire time duration for the first example is 70~90ms, while the second example cost around 200 ms. The input shape is [1280,1280, 50], num_input_features = 4
1)
self.middle_spconv = spconv.SparseSequential(
spconv.SubMConv3d(num_input_features, 16, 3, bias=False, indice_key="subm0"),
nn.BatchNorm1d(16, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(16, 16, 3, bias=False, indice_key="subm0"),
nn.BatchNorm1d(16, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(16, 32, 3, 2, bias=False, padding=1), # [1280, 1280, 50] -> [640, 640, 25]
nn.BatchNorm1d(32, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(32, 32, 3, bias=False, indice_key="subm1"),
nn.BatchNorm1d(32, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(32, 32, 3, bias=False, indice_key="subm1"),
nn.BatchNorm1d(32, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(32, 64, 3, 2, bias=False, padding=1), # [640, 640, 25] -> [320, 320, 13]
nn.BatchNorm1d(64, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(64, 64, 3, bias=False, indice_key="subm2"),
nn.BatchNorm1d(64, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(64, 64, 3, bias=False, indice_key="subm2"),
nn.BatchNorm1d(64, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(64, 96, 3, 2, bias=False, padding=1), # [320, 320, 13] -> [160, 160, 7]
nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(96, 96, 3, bias=False, indice_key="subm3"),
nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(96, 96, 3, bias=False, indice_key="subm3"),
nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(96, 96, 3, bias=False, indice_key="subm3"),
nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(96, 128, 3, 2, bias=False, padding=1), # [160, 160, 7] -> [80, 80,4]
nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(128, 128, 3, bias=False, indice_key="subm4"),
nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(128, 128, 3, bias=False, indice_key="subm4"),
nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(128, 128, 3, bias=False, indice_key="subm4"),
nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(128, 160, 3, 2, bias=False, padding=1), # [80, 80, 4] -> [40, 40, 2]
nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(160, 160, 3, bias=False, indice_key="subm5"),
nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(160, 160, 3, bias=False, indice_key="subm5"),
nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(160, 160, 3, bias=False, indice_key="subm5"),
nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(160, 192, 3, 2, bias=False, padding=1), # [40, 40, 2] -> [20, 20, 1]
nn.BatchNorm1d(192, eps=1e-3, momentum=0.01),
nn.ReLU(),
)

` self.middle_conv_block1 = spconv.SparseSequential(
spconv.SubMConv3d(num_input_features, 16, 3, bias=False, indice_key="subm0"),
nn.BatchNorm1d(16, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SubMConv3d(16, 16, 3, bias=False, indice_key="subm0"),
nn.BatchNorm1d(16, eps=1e-3, momentum=0.01),
nn.ReLU(),
spconv.SparseConv3d(16, 32, 3, 2, bias=False, padding=1), # [1280, 1280, 50] -> [640, 640, 25]
nn.BatchNorm1d(32, eps=1e-3, momentum=0.01),
nn.ReLU(),
)

    self.middle_conv_block2 = spconv.SparseSequential(
        spconv.SubMConv3d(32, 32, 3, bias=False, indice_key="subm1"),
        nn.BatchNorm1d(32, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(32, 32, 3, bias=False, indice_key="subm1"),
        nn.BatchNorm1d(32, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SparseConv3d(32, 64, 3, 2, bias=False, padding=1), # [640, 640, 25] -> [320, 320, 13]
        nn.BatchNorm1d(64, eps=1e-3, momentum=0.01),
        nn.ReLU(),
    )

    self.middle_conv_block3 = spconv.SparseSequential(
        spconv.SubMConv3d(64, 64, 3, bias=False, indice_key="subm2"),
        nn.BatchNorm1d(64, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(64, 64, 3, bias=False, indice_key="subm2"),
        nn.BatchNorm1d(64, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SparseConv3d(64, 96, 3, 2, bias=False, padding=1),  # [320, 320, 13] -> [160, 160, 7]
        nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
        nn.ReLU(),
    )

    self.middle_conv_block4 = spconv.SparseSequential(
        spconv.SubMConv3d(96, 96, 3, bias=False, indice_key="subm3"),
        nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(96, 96, 3, bias=False, indice_key="subm3"),
        nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(96, 96, 3, bias=False, indice_key="subm3"),
        nn.BatchNorm1d(96, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SparseConv3d(96, 128, 3, 2, bias=False, padding=1),  # [160, 160, 7] -> [80, 80,4]
        nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
        nn.ReLU(),
    )

    self.middle_conv_block5 = spconv.SparseSequential(
        spconv.SubMConv3d(128, 128, 3, bias=False, indice_key="subm4"),
        nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(128, 128, 3, bias=False, indice_key="subm4"),
        nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(128, 128, 3, bias=False, indice_key="subm4"),
        nn.BatchNorm1d(128, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SparseConv3d(128, 160, 3, 2, bias=False, padding=1),  # [80, 80, 4] -> [40, 40, 2]
        nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
        nn.ReLU(),
    )

    self.middle_conv_block6 = spconv.SparseSequential(
        spconv.SubMConv3d(160, 160, 3, bias=False, indice_key="subm5"),
        nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(160, 160, 3, bias=False, indice_key="subm5"),
        nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SubMConv3d(160, 160, 3, bias=False, indice_key="subm5"),
        nn.BatchNorm1d(160, eps=1e-3, momentum=0.01),
        nn.ReLU(),
        spconv.SparseConv3d(160, 192, 3, 2, bias=False, padding=1),  # [40, 40, 2] -> [20, 20, 1]
        nn.BatchNorm1d(192, eps=1e-3, momentum=0.01),
        nn.ReLU(),
    )`

Specifically, the middle_conv_block2 cost around 100ms on my machine. Am I doing anything wrong or it is caused by spconv's mechanism?

Thanks in advance.

ImportError: cannot import name 'rbbox_intersection'

>>> from spconv.utils import rbbox_iou
>>> from spconv.utils import rbbox_intersection
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'rbbox_intersection'
>>> 

new spconv cant be installed

I have installed the old version successfully, but the version you upload 12 days ago can not be installed. It shows

/home/PC/spconv/third_party/pybind11

does not contain a CMakeLists.txt file.

Is there any file missed?

Can't get anything after run "python setup.py install"

I have downloaded libtorch and
export LIBTORCH_ROOT=/media/omnisky/data/liuhao/libtorch/
and installed camke3.13.3 and
export PATH=/media/omnisky/data/liuhao/cmake-3.13.3/bin/cmake:$PATH
then i run python setup.py install but got nothing
image
I have waited about one hour, is there anything wrong?Should i wait so long time?

ModuleNotFoundError: No module named 'spconv.utils'

I followed the procedure and build exactly exactly the lib
a) python setup.py bdist_wheel
b) cd ./dist
c) pip install spconv*.whl

but iam getting an error below:
from spconv.utils import rbbox_iou

Also iam unable to run python test/test_conv.py: Error below
ModuleNotFoundError: No module named 'spconv.test_utils'

Kindly help

error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
[ 57%] Built target spconv_utils
In file included from /usr/include/c++/4.9/atomic:38:0,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/TensorTypeIdRegistration.h:15,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/Backend.h:5,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/Layout.h:3,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/core/Type.h:7,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/Type.h:2,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/Context.h:4,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/ATen.h:5,
from /home/jiangzhengkai/3d-detection/second.pytorch/spconv/src/spconv/reordering.cu:15:
/usr/include/c++/4.9/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently
experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
In file included from /usr/include/c++/4.9/atomic:38:0,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/TensorTypeIdRegistration.h:15,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/Backend.h:5,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/Layout.h:3,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/core/Type.h:7,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/Type.h:2,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/Context.h:4,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/ATen.h:5,
from /home/jiangzhengkai/3d-detection/second.pytorch/spconv/src/spconv/indice.cu:15:
/usr/include/c++/4.9/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently
experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
In file included from /usr/include/c++/4.9/atomic:38:0,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/TensorTypeIdRegistration.h:15,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/Backend.h:5,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/c10/core/Layout.h:3,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/core/Type.h:7,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/Type.h:2,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/Context.h:4,
from /home/jiangzhengkai/anaconda3/lib/python3.7/site-packages/torch/lib/include/ATen/ATen.h:5,
from /home/jiangzhengkai/3d-detection/second.pytorch/spconv/src/spconv/maxpool.cu:15:
/usr/include/c++/4.9/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently
experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cu.o] Error 1

Remove spconv

I accidentally installed it using python3.5. How can I remove it?

Error: Cannot call member function without object.

Python version:

Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux

GCC version:

 mariyan@mz-lin:~/dev/spconv$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

This is the error I am getting, any help would be appreciated! (essentially there are several errors that all say cannot call member function without object.)

tf) mariyan@mz-lin:~/dev/spconv$ python setup.py  bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=/home/mariyan/.conda/envs/tf/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/mariyan/dev/spconv/build/lib.linux-x86_64-3.7/spconv', '-DCMAKE_BUILD_TYPE=Release']
-- Caffe2: CUDA detected: 10.1.105
-- Caffe2: CUDA nvcc is: /usr/local/cuda-10.1/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-10.1
-- Caffe2: Header version is: 10.1
-- Found cuDNN: v7.5.0  (include: /usr/local/cuda-10.1/include, library: /usr/local/cuda-10.1/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- pybind11 v2.3.dev0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mariyan/dev/spconv/build/temp.linux-x86_64-3.7
[  7%] Building CUDA object src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o
[ 14%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/indice.cu.o
[ 28%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/maxpool.cu.o
[ 28%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/reordering.cu.o
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6679:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
       __p->_M_set_sharable();
       ~~~~~~~~~^~
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6684:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
src/utils/CMakeFiles/spconv_nms.dir/build.make:62: recipe for target 'src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o' failed
make[2]: *** [src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o] Error 1
CMakeFiles/Makefile2:202: recipe for target 'src/utils/CMakeFiles/spconv_nms.dir/all' failed
make[1]: *** [src/utils/CMakeFiles/spconv_nms.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6679:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
       __p->_M_set_sharable();
       ~~~~~~~~~^~
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6684:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
src/spconv/CMakeFiles/spconv.dir/build.make:88: recipe for target 'src/spconv/CMakeFiles/spconv.dir/indice.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6679:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
       __p->_M_set_sharable();
       ~~~~~~~~~^~
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6684:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
src/spconv/CMakeFiles/spconv.dir/build.make:114: recipe for target 'src/spconv/CMakeFiles/spconv.dir/reordering.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/reordering.cu.o] Error 1
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6679:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
       __p->_M_set_sharable();
       ~~~~~~~~~^~
/usr/include/c++/7/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/7/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5033:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.h:5054:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/7/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/7/bits/basic_string.h:6684:95:   required from here
/usr/include/c++/7/bits/basic_string.tcc:1067:16: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
src/spconv/CMakeFiles/spconv.dir/build.make:140: recipe for target 'src/spconv/CMakeFiles/spconv.dir/maxpool.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/maxpool.cu.o] Error 1
CMakeFiles/Makefile2:108: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all' failed
make[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 89, in <module>
    zip_safe=False,
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
    self.run_command('build')
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 40, in run
    self.build_extension(ext)
  File "setup.py", line 73, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/home/mariyan/.conda/envs/tf/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.

Comparing with Facebook SparseCNN

Hi Yan,

The spconv is indeed faster than the one of Facebook on the KITTI object detection task, however, when I move the spconv to do the semantic segmentation task on scannet where Unet is built and a lot of deconvolutions layers are required, the speed of spconv (~12s per iteration) is three times slower than the one of Facebook(~4s per iteration) under the similar training setting. Do you have some ideas about the reason?

cuda execution failed with error 8: invalid device function

When I run the test code , I get an error, which shows "cuda execution failed with error 8", and I print the error code ,it means "invalid device function".
Also , this error occurs when I run the code of second, Can anybody help me?
Cuda 9.0 + Gcc 5.5

kernelVolume <= 256 assert faild. error

I'm getting the following error when instantiating a SubMConv3d with kernel size of 15.

kernelVolume <= 256 assert faild. error
Traceback (most recent call last):
File "./pytorch/train.py", line 605, in
fire.Fire()
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
component, remaining_args)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File "./pytorch/train.py", line 420, in train
raise e
File "./pytorch/train.py", line 307, in train
ret_dict = net_parallel(example_torch)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/franciscorubin/Projects/TFM/second.pytorch/second/pytorch/models/voxelnet.py", line 265, in forward
voxel_features, coors, batch_size_dev)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/franciscorubin/Projects/TFM/second.pytorch/second/pytorch/models/middle.py", line 106, in forward
ret = self.middle_conv(ret)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/spconv/modules.py", line 123, in forward
input = module(input)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/spconv/conv.py", line 155, in forward
self.stride, self.padding, self.dilation, self.output_padding, self.subm, self.transposed, grid=input.grid)
File "/home/franciscorubin/miniconda3/envs/dl/lib/python3.6/site-packages/spconv/ops.py", line 89, in get_indice_pairs
stride, padding, dilation, out_padding, int(subm), int(transpose))
RuntimeError: /home/franciscorubin/Installations/spconv/include/spconv/spconv_ops.h 50
kernelVolume <= 256 assert faild. error

Apparently the kernel volume can't be bigger than 256, so I can't use kernel sizes of (7x7x7) in 3d convolutions. Is there a reason for this?

No CUDA toolset found. - win10, cuda-v9.1

PS F:\3D-Object-Detection\spconv> python .\setup.py bdist_wheel
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\spconv
copying spconv\conv.py -> build\lib.win-amd64-3.6\spconv
copying spconv\functional.py -> build\lib.win-amd64-3.6\spconv
copying spconv\modules.py -> build\lib.win-amd64-3.6\spconv
copying spconv\ops.py -> build\lib.win-amd64-3.6\spconv
copying spconv\pool.py -> build\lib.win-amd64-3.6\spconv
copying spconv\test_utils.py -> build\lib.win-amd64-3.6\spconv
copying spconv\__init__.py -> build\lib.win-amd64-3.6\spconv
creating build\lib.win-amd64-3.6\spconv\utils
copying spconv\utils\__init__.py -> build\lib.win-amd64-3.6\spconv\utils
running build_ext
Release
|||||CMAKE ARGS||||| ['-DCMAKE_PREFIX_PATH=C:\\ProgramData\\Anaconda3\\lib\\site-packages\\torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=F:\\3D-Object-Detection\\spconv\\build\\lib.win-amd64-3.6\\spconv', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=F:\\3D-Object-Detection\\spconv\\build\\lib.win-amd64-3.6\\spconv', '-A', 'x64']
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The CXX compiler identification is MSVC 19.16.27026.1
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:271 (message):
  No CUDA toolset found.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeDetermineCUDACompiler.cmake:72 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "F:/3D-Object-Detection/spconv/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File ".\setup.py", line 89, in <module>
    zip_safe=False,
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 202, in run
    self.run_command('build')
  File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File ".\setup.py", line 40, in run
    self.build_extension(ext)
  File ".\setup.py", line 72, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'F:\\3D-Object-Detection\\spconv', '-DCMAKE_PREFIX_PATH=C:\\ProgramData\\Anaconda3\\lib\\site-packages\\torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=F:\\3D-Object-Detection\\spconv\\build\\lib.win-amd64-3.6\\spconv', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=F:\\3D-Object-Detection\\spconv\\build\\lib.win-amd64-3.6\\spconv', '-A', 'x64']' returned non-zero exit status 1.

Does it only supports cuda-v10? Thanks.

cuda runtime error

Hello Yan @traveller59 ,

I got the following error when I try to increase the batch size.
I am trying to add branches to middle sparse layers. I can train the network when batch size <=3, while get errors when batch size >=4.
Environment:
GPU: 1080ti
OS: Ubuntu 16.04
Cuda 10.0, pytorch 1.0, python 2.7

The network structure is like:

def forward(self, voxel_features, coors, self.sparse_shape, batch_size):
ret0 = spconv.SparseConvTensor(voxel_features, coors, self.sparse_shape, batch_size)
ret1 = self.middle_conv_block1(ret0)   ##spconv.SparseSequential
ret2 = self.middle_conv_block2(ret1)   ##spconv.SparseSequential
ret3 = self.middle_conv_block3(ret2)   ##spconv.SparseSequential
ret4 = self.middle_conv_block3(ret3)   ##spconv.SparseSequential

branch_feature_2 = self.sparse_branch_1(ret2)  ##spconv.SparseSequential
branch_feature_3 = self.sparse_branch_2(ret3)  ##spconv.SparseSequential

predict1 = self.rpn1(branch_feature_2.dense())   ##  nn.conv2d
predict2 = self.rpn2(branch_feature_3.dense())   ##  nn.conv2d
predict3 = self.rpn3(ret4.dense())                         ##  nn.conv2d

return predict1, predict2, predict3

The error is:

Traceback (most recent call last):
  File "main.py", line 238, in <module>
    main()
  File "main.py", line 234, in main
    exp.run()
  File "main.py", line 180, in run
    self.trainer.run(epoch, mode="train")
  File "/media/DataCenter/deeplearningoflidar/YL/mjj2/projects/anchor_based/apollo_spenet/trainer.py", line 396, in run
    predict = self.model(voxels,coors,num_points, batch_size)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/DataCenter/deeplearningoflidar/YL/mjj2/projects/anchor_based/apollo_spenet/model/SPENet/spenet.py", line 294, in forward
    sparse_feature = self.middle_sparse(vfe_feature,coors,batch_size)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/DataCenter/deeplearningoflidar/YL/mjj2/projects/anchor_based/apollo_spenet/model/SPENet/spenet.py", line 264, in forward
    branch_feature3 = self.sparse_branch_2(ret3)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/spconv/modules.py", line 127, in forward
    input.features = module(input.features)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/batchnorm.py", line 76, in forward
    exponential_average_factor, self.eps)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 1623, in batch_norm
    training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: cuda runtime error (9) : invalid configuration argument at /pytorch/aten/src/ATen/native/cuda/Normalization.cuh:459

Any idea why this is happening?
Thanks in advance.

How to add two SparseConvTensor?

Thanks for your great work !

I want to create ResNet style structure using spconv.
But it seems that i can't add two SparseConvTensor directly.
Is there any solution?

about installing setup.py

I encounter a error when running setup.py following the readme command line.
how to fix it?
Environment:
ubuntu 16.04
pytorch 1.0.1
cuda 9.0
cudnn 7.4.1
gcc/g++ 5.4

error message:
Scanning dependencies of target spconv_nms Scanning dependencies of target spconv [ 7%] Building CUDA object src/utils/CMakeFiles/spconv_nms.dir/nms.cu.o [ 21%] Building CXX object src/spconv/CMakeFiles/spconv.dir/all.cc.o [ 28%] Building CXX object src/spconv/CMakeFiles/spconv.dir/indice.cc.o [ 28%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/indice.cu.o [ 35%] Linking CUDA static library libspconv_nms.a [ 35%] Built target spconv_nms [ 42%] Building CXX object src/spconv/CMakeFiles/spconv.dir/reordering.cc.o [ 50%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/reordering.cu.o [ 57%] Building CXX object src/spconv/CMakeFiles/spconv.dir/maxpool.cc.o [ 64%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/maxpool.cu.o Scanning dependencies of target spconv_utils [ 71%] Linking CUDA device code CMakeFiles/spconv.dir/cmake_device_link.o [ 78%] Linking CXX shared library ../../../lib.linux-x86_64-3.7/spconv/libspconv.so /usr/bin/ld: cannot find /usr/local/cudnn/lib64/: File format not recognized collect2: error: ld returned 1 exit status src/spconv/CMakeFiles/spconv.dir/build.make:238: recipe for target '../lib.linux-x86_64-3.7/spconv/libspconv.so' failed make[2]: *** [../lib.linux-x86_64-3.7/spconv/libspconv.so] Error 1 CMakeFiles/Makefile2:108: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all' failed make[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 85%] Building CXX object src/utils/CMakeFiles/spconv_utils.dir/all.cc.o [ 92%] Linking CUDA device code CMakeFiles/spconv_utils.dir/cmake_device_link.o [100%] Linking CXX shared library ../../../lib.linux-x86_64-3.7/spconv/spconv_utils.cpython-37m-x86_64-linux-gnu.so [100%] Built target spconv_utils Makefile:129: recipe for target 'all' failed make: *** [all] Error 2 Traceback (most recent call last): File "setup.py", line 89, in <module> zip_safe=False, File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run self.run_command('build') File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 40, in run self.build_extension(ext) File "setup.py", line 73, in build_extension subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) File "/home/muzhengyang/anaconda3/envs/SECOND/lib/python3.7/subprocess.py", line 347, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.

Excessive memory usage on high-dimensional input data

I'm processing a point cloud with 40k points, but that is divided into a voxelgrid with big dimensions: [5000, 3000, 200].

The problem appears when I try to run it through a SubMConv3d layer with kernel_size of 3 and input/output_channels of 1. It tries to allocate 20 gb of memory in GPU and it crashes.

I traced the error to the method "getIndicePair" of class spconv_ops.h on the following lines:

  torch::Tensor gridOut =
      torch::full({batchSize * outputVolume}, -1,
                  torch::dtype(torch::kInt32).device(indices.device()));

In my case the outputVolume is 5000 * 3000 * 200 and causes the crash.

Why do we need to create a matrix that big? This algorithm is supposed to work on sparse matrices, so shouldn't the intermediate matrices created be also sparse? On a Submanifold Sparse CNN the output cells are always the same as the input cells, and the rest stays as 0. Why do we need to create a full grid for it?

Make failed

Pytorch: 1.0
Cuda: 9.0
Cmake 3.13

[ 35%] Linking CUDA device code CMakeFiles/spconv_nms.dir/cmake_device_link.o
[ 42%] Linking CUDA shared library ../../../lib.linux-x86_64-2.7/spconv/libspconv_nms.so
[ 42%] Built target spconv_nms
[ 50%] Building CXX object src/spconv/CMakeFiles/spconv.dir/reordering.cc.o
92 errors detected in the compilation of "/tmp/tmpxft_000020f5_00000000-6_indice.cpp1.ii".
src/spconv/CMakeFiles/spconv.dir/build.make:88: recipe for target 'src/spconv/CMakeFiles/spconv.dir/indice.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Scanning dependencies of target spconv_utils
[ 57%] Building CXX object src/utils/CMakeFiles/spconv_utils.dir/all.cc.o
CMakeFiles/Makefile2:108: recipe for target 'src/spconv/CMakeFiles/spconv.dir/all' failed
make[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 64%] Linking CXX shared library ../../../lib.linux-x86_64-2.7/spconv/spconv_utils.so
[ 64%] Built target spconv_utils
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 86, in <module>
    zip_safe=False,
  File "/home/dhingratul/.virtualenvs/spconv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/dhingratul/.virtualenvs/spconv/local/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 192, in run
    self.run_command('build')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 39, in run
    self.build_extension(ext)
  File "setup.py", line 70, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2

Not able to run stup.py

Hi @traveller59 I am trying to install this module and getting this error. Please could you have a look.

Release
-- Caffe2: CUDA detected: 9.0.176
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 9.0
-- Found cuDNN: v7.3.1 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1;6.1;6.1;6.1;6.1;6.1;6.1;6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
CMake Error at CMakeLists.txt:28 (add_subdirectory):
The source directory

/root/spconv/third_party/pybind11

does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred!
See also "/root/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/root/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "setup.py", line 86, in
zip_safe=False,
File "/usr/local/lib/python3.6/dist-packages/setuptools/init.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.6/dist-packages/wheel/bdist_wheel.py", line 192, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 39, in run
self.build_extension(ext)
File "setup.py", line 69, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/root/spconv', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/root/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_PREFIX_PATH=/usr/local/lib/python3.6/dist-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

errors when running "python setup.py bdist_wheel"

Hi, I get lots of errors when I running "python setup.py bdist_wheel". My environment is pytorch1.0.1, cuda9+. The errors are something like "/usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlintrin.h(11300): error: argument of type "void *" is incompatible with parameter of type "long long *"". I guess maybe it is due to gcc version. So, I wonder what is your gcc version?

nvcc error when complie spconv

chenly@chenly-System-Product-Name:/media/chenly/E/spconv$ python setup.py install
running install
running bdist_egg
running egg_info
writing spconv.egg-info/PKG-INFO
writing dependency_links to spconv.egg-info/dependency_links.txt
writing top-level names to spconv.egg-info/top_level.txt
reading manifest file 'spconv.egg-info/SOURCES.txt'
writing manifest file 'spconv.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
/media/chenly/E/spconv/build/lib.linux-x86_64-3.6
/media/chenly/F/LibTorch/libtorch:/media/chenly/F/LibTorch/libtorch:/media/chenly/F/LibTorch/libtorch:/media/chenly/F/LibTorch/libtorch::/media/chenly/F/LibTorch/libtorch
Release
-- Caffe2: CUDA detected: 9.0.176
-- Caffe2: CUDA nvcc is: /usr/local/cuda-9.0/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-9.0
-- Caffe2: Header version is: 9.0
-- Found cuDNN: v7.1.4 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Could NOT find torch (missing: TORCH_LIBRARY)
-- pybind11 v2.3.dev0
-- Configuring done
-- Generating done
-- Build files have been written to: /media/chenly/E/spconv/build/temp.linux-x86_64-3.6
[ 21%] Built target spconv_nms
[ 35%] Built target spconv_utils
[ 42%] Building CXX object src/spconv/CMakeFiles/spconv.dir/all.cc.o
[ 50%] Building CXX object src/spconv/CMakeFiles/spconv.dir/indice.cc.o
[ 57%] Building CXX object src/spconv/CMakeFiles/spconv.dir/reordering.cc.o
[ 64%] Building CUDA object src/spconv/CMakeFiles/spconv.dir/indice.cu.o
nvcc fatal : redefinition of argument 'std'
src/spconv/CMakeFiles/spconv.dir/build.make:88: recipe for target 'src/spconv/CMakeFiles/spconv.dir/indice.cu.o' failed
make[2]: *** [src/spconv/CMakeFiles/spconv.dir/indice.cu.o] Error 1

compile error in aarch64 platform

I am trying to compile spconv in Linux aarch64 platform, But the error occur when compileing
image

it looks like the pytorch lib is incomplete,
Ubuntu 18.04 LTS + python3.6 + CUDA10.0 + cmake3.14.0
everything going fine in my x86 PC platform with the same code.
hopefully for any advice, thanks!

compile error

Hi I got this error when I was compiling the spconv
-- Generating done
-- Build files have been written to: /share2/public/wangjingbo/Workspace/spconv/build/temp.linux-x86_64-3.6
[ 13%] Built target spconv_nms
gmake[2]: *** 没有规则可以创建“src/spconv/CMakeFiles/spconv.dir/cmake_device_link.o”需要的目标“/usr/local/cuda/lib64/libculibos.a”。 停止。
gmake[1]: *** [src/spconv/CMakeFiles/spconv.dir/all] 错误 2
gmake[1]: *** 正在等待未完成的任务....
[ 33%] Built target spconv_utils
gmake: *** [all] 错误 2

I do not have the sudo permission so I can not instal cuda at /usr/local.
How can I fix this bug, thanks!

Error when import spconv

I have successfully installed the spconv in my docker pull from nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04. It says all dependencies have been successfully installed. However, when I import it in python 3.6, it give me this error:
image
However, I can find the libspconv_nms.so.1 in my lib: /usr/local/lib/python3.6/dist-packages/spconv-1.0-py3.6-linux-x86_64.egg/spconv and if I run python3.6 there and import spconv it is all good.

The python path is:
image
spconv is in there.

What should I do? I am new to docker and I don't know what's going on
I also tried adding the egg/spconv in PYTHONPATH. Still not working

CUDA compiler error

error as following:

(python3.6) [zhouxiangxin@mad-wing ~/exp/3d_detection/experiments/spconv]$ sudo python3.6 setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
/home/zhouxiangxin/exp/3d_detection/experiments/spconv/build/lib.linux-x86_64-3.6
Release
-- The CUDA compiler identification is unknown
-- Check for working CUDA compiler: /unsullied/sharefs/_admin/cuda/cuda-9.0/cuda/bin/nvcc
-- Check for working CUDA compiler: /unsullied/sharefs/_admin/cuda/cuda-9.0/cuda/bin/nvcc -- broken
CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCUDACompiler.cmake:46 (message):
  The CUDA compiler

    "/unsullied/sharefs/_admin/cuda/cuda-9.0/cuda/bin/nvcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/zhouxiangxin/exp/3d_detection/experiments/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_7a980/fast"
    /usr/bin/make -f CMakeFiles/cmTC_7a980.dir/build.make CMakeFiles/cmTC_7a980.dir/build
    make[1]: Entering directory '/home/zhouxiangxin/exp/3d_detection/experiments/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
    make[1]: Warning: File 'CMakeFiles/cmTC_7a980.dir/progress.make' has modification time 0.0067 s in the future
    Building CUDA object CMakeFiles/cmTC_7a980.dir/main.cu.o
    /unsullied/sharefs/_admin/cuda/cuda-9.0/cuda/bin/nvcc    "--expt-relaxed-constexpr"    -x cu -c /home/zhouxiangxin/exp/3d_detection/experiments/
spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_7a980.dir/main.cu.o
    gcc: error trying to exec 'cc1plus': execvp: No such file or directory
    CMakeFiles/cmTC_7a980.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_7a980.dir/main.cu.o' failed
    make[1]: *** [CMakeFiles/cmTC_7a980.dir/main.cu.o] Error 1
    make[1]: Leaving directory '/home/zhouxiangxin/exp/3d_detection/experiments/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_7a980/fast' failed
    make: *** [cmTC_7a980/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/home/zhouxiangxin/exp/3d_detection/experiments/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/home/zhouxiangxin/exp/3d_detection/experiments/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 86, in <module>
    zip_safe=False,
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/site-packages/setuptools/__init__.py", line 143, in setup
    return distutils.core.setup(**attrs)
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
    self.run_command('build')
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 39, in run
    self.build_extension(ext)
  File "setup.py", line 69, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/home/zhouxiangxin/anaconda3/envs/python3.6/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['cmake', '/home/zhouxiangxin/exp/3d_detection/experiments/spconv', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/
zhouxiangxin/exp/3d_detection/experiments/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_PREFIX_PATH=/home/zhouxiangxin/anaconda3/envs/python3.
6/lib/python3.6/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '
-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

in the terminal, I can use nvcc normally.

How to extract the output feature map of each layer in spconv

For example,

            SubMConv3d(num_input_features, 16, 3, indice_key="subm0"),
            BatchNorm1d(16),
            nn.ReLU(),
            SubMConv3d(16, 16, 3, indice_key="subm0"),
            BatchNorm1d(16),
            nn.ReLU(),
            SpConv3d(16, 32, 3, 2, padding=1), 
            BatchNorm1d(32),
            nn.ReLU(),
            SubMConv3d(32, 32, 3, indice_key="subm1"),
            BatchNorm1d(32),
            nn.ReLU(),
            SubMConv3d(32, 32, 3, indice_key="subm1"),
            BatchNorm1d(32),
            nn.ReLU(),
            SpConv3d(32, 64, 3, 2, padding=1), 
            BatchNorm1d(64),
            nn.ReLU(),
            SubMConv3d(64, 64, 3, indice_key="subm2"),
            BatchNorm1d(64),
            nn.ReLU(),
            SubMConv3d(64, 64, 3, indice_key="subm2"),
            BatchNorm1d(64),
            nn.ReLU(),

How can I get the output feature map of each layer?
update-------------------------------------------------------------------------------------------
After reading the source codes about SparseSequential, I have figured it out.

no cmake cuda provide

Error:

- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_CUDA_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/media/jintain/sg/ai/career/robot/ctirobot/fruits/3d_det/second_pytorch/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeOutput.log".
See also "/media/jintain/sg/ai/career/robot/ctirobot/fruits/3d_det/second_pytorch/spconv/build/temp.linux-x86_64-3.6/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 82, in <module>
    zip_safe=False,
  File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/dist-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/usr/lib/python3.6/distutils/command/install_lib.py", line 109, in build
    self.run_command('build_ext')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 35, in run
    self.build_extension(ext)
  File "setup.py", line 65, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/media/jintain/sg/ai/career/robot/ctirobot/fruits/3d_det/second_pytorch/spconv', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/media/jintain/sg/ai/career/robot/ctirobot/fruits/3d_det/second_pytorch/spconv/build/lib.linux-x86_64-3.6/spconv', '-DCMAKE_PREFIX_PATH=./libtorch', '-DPYBIND11_PYTHON_VERSION=3.6', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.