Pointnet++ 编译 tf_ops 遇到的问题及解决办法
pointnet++在pointnet 的基础上,提出了一个分层特征提取方法。其中涉及到采样(sampling layer),分组(grouping layer)和插值(interpolation layer)操作。再复现其代码时,最主要的问题就是集中在对上述三种操作的代码编译生成“xxxxxxx_so.so”文件。
1、修改编译文件,以“/samping/tf_sampling_compile.sh”为例
- Github 上提供的源代码如下,有TF1.2和TF1.4两种版本
#/bin/bash
/usr/local/cuda-8.0/bin/nvcc tf_sampling_g.cu -o tf_sampling_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
# TF1.2
g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I /usr/local/lib/python2.7/dist