美文网首页
undefined symbol: _ZTIN10tensorf

undefined symbol: _ZTIN10tensorf

作者: Persistently | 来源:发表于2020-04-07 00:55 被阅读0次

因为没有在g++中加入 -ltensorflow_framework

tf.sysconfig.get_link_flags()



把-L和-l的内容要对应写正确,这样编译才能通过

#!/usr/bin/env bash
nvcc=/usr/local/cuda-10.1/bin/nvcc
cudalib=/usr/local/cuda-10.1/lib64/
TF_INC=$(python3 -c 'import tensorflow as tf; print(tf.sysconfig.get_include())')
TF_LIB=$(python3 -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')

g++ tf_interpolate.cpp -o tf_interpolate_so.so -std=c++11  -shared -fPIC -I $TF_INC  \
-I$TF_INC/external/nsync/public -L$TF_LIB -l:libtensorflow_framework.so.2 \
-lcudart -L $cudalib -O2 -D_GLIBCXX_USE_CXX11_ABI=0

相关文章

网友评论

      本文标题:undefined symbol: _ZTIN10tensorf

      本文链接:https://www.haomeiwen.com/subject/shmwphtx.html