Minkowski Engine踩坑记录
安装
1. CUDA 路径错误
:/usr/local/cuda/bin/nvcc: not found
莫名其妙多了一个冒号,重新export一下cuda路径
export CUDA_HOME=/usr/local/cuda
2.
V0.5用pytorch1.7.1,本地下载git repo,然后运行
python setup.py install
其他版本的pytorch各种奇怪错误(2021.06.21)
API
1. 预处理后离散的voxels回到原点云domain:slice(X)
1 # Args: 2 # X (MinkowskiEngine.SparseTensor): a sparse tensor that discretized the original input. 3 # Returns: 4 # tensor_field (MinkowskiEngine.TensorField): the resulting tensor field contains features on the continuous coordinates that generated the input X. 5 6 # Example: 7 # coords, feats from a data loader 8 print(len(coords)) # 227742 9 tfield = ME.TensorField(coordinates=coords, features=feats, quantization_mode=SparseTensorQuantizationMode.UNWEIGHTED_AVERAGE) # >=v0.5 10 print(len(tfield)) # 227742 11 sinput = tfield.sparse() # 161890 quantization results in fewer voxels 12 soutput = MinkUNet(sinput) 13 print(len(soutput)) # 161890 Output with the same resolution 14 ofield = soutput.slice(tfield) 15 assert isinstance(ofield, ME.TensorField) 16 len(ofield) == len(coords) # recovers the original ordering and length 17 assert isinstance(ofield.F, torch.Tensor) # .F returns the features