tf编译pointnet2-master中sampling层

本文介绍了如何在TensorFlow中编译PointNet2的sampling层。首先,需要修改`tf_sampling_compile.sh`文件的参数,并将所有涉及TensorFlow的路径替换为TF_ROOT。确保CUDA路径正确,并匹配TensorFlow的兼容版本。当遇到编译问题时,检查g++和TensorFlow版本的兼容性。在编译成功后,如果遇到`undefined symbol`错误,可能是TensorFlow版本不匹配,需要根据情况选择合适的代码段。最后,如果编译后的.so文件报错,删除并重新编译以解决问题。
摘要由CSDN通过智能技术生成

1 .\tf_ops\sampling\文件夹下

打开tf_sampling_compile.sh

修改几个参数

#/bin/bash
/usr/local/cuda/bin/nvcc tf_sampling_g.cu -o tf_sampling_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC

TF_ROOT=./venv/lib/python3.6/site-packages/tensorflow
# TF1.2
#g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I ${TF_ROOT}/include -I /usr/local/cuda/include -lcudart -L /usr/local/cuda/lib64/ -O2 -D_GLIBCXX_USE_CXX11_ABI=0


# TF1.4
g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I ${TF_ROOT}/include -I /usr/local/cuda/include -I ${TF_ROOT}/include/external/nsync/public -lcudart -L /usr/local/cuda/lib64/ -L ${TF_ROOT}  -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值