如何编译TF运算符

2024-10-01 22:37:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一些点云,我尝试使用PU-GAN对它们进行上采样。在第二步中,我需要编译TF操作符。事实上,我不熟悉TF,所以我可能完全走错了方向

For compiling TF operators, please check `tf_xxx_compile.sh` under each op subfolder in `code/tf_ops` folder.

在tf_ops中的子文件夹“approxmatch”中,我刚刚尝试执行以下命令:

sh tf_approxmatch_compile.sh

然而,我得到了以下错误:

fatal error: tensorflow/core/framework/op.h: No such file or directory
 #include "tensorflow/core/framework/op.h"

我检查了路径,然后添加了它们

TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())')
TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')

由于这个错误,我查看了tensorflow/core/framework文件夹。但里面没有op.h

我错过了什么


Tags: coreimport文件夹includetftensorflowassh
1条回答
网友
1楼 · 发布于 2024-10-01 22:37:14

对于tensorflow 1.5、python 3.6、cuda 10.0

/usr/local/cuda-10.0/bin/nvcc tf_approxmatch_g.cu -o tf_approxmatch_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
g++ -std=c++11 tf_approxmatch.cpp tf_approxmatch_g.cu.o -o tf_approxmatch_so.so -shared -fPIC -I /home/alitokur/Softwares/try/python36/lib/python3.6/site-packages/tensorflow_core/include -I /usr/local/cuda-10.0/include -I /home/alitokur/Softwares/try/python36/lib/python3.6/site-packages/tensorflow_core/include/external/nsync/public -lcudart -L /usr/local/cuda-10.0/lib64/ -L /home/alitokur/Softwares/try/python36/lib/python3.6/site-packages/tensorflow_core -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0

相关问题 更多 >

    热门问题