修改makefile文件 undefined symbol: _ZTIN10tensorflow8OpKernelE

由于需要,把tensorflow-gpu1.3版本升级成了tensorflow-gpu1.4,之后运行代码报错undefined symbol: _ZTIN10tensorflow8OpKernelE,在网上查到说要改Makefile,

我在makefile文件中加了TF_LIB那一行并在下面加入$TF_LIB -ltensorflow_framework -D GOOGLE_CUDA=1 \-fPIC

却报错

是不是我哪里改的不对呢,应该怎么改呢,或者还有没有别的方法解决undefined symbol: _ZTIN10tensorflow8OpKernelE呢?

这是我的makefile文件:

nvcc = /usr/local/cuda-8.0/bin/nvcc
cudalib = /usr/local/cuda-8.0/lib64/
tensorflow =/home/yao/anaconda2/envs/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/include
all: utils/tf_ops/cd/tf_nndistance_so.so utils/show_3d/render_balls_so.so utils/tf_ops/emd/tf_auctionmatch_so.so
.PHONY : all
utils/tf_ops/cd/tf_nndistance_so.so: utils/tf_ops/cd/tf_nndistance_g.cu.o utils/tf_ops/cd/tf_nndistance.cpp
 g++ -std=c++11 utils/tf_ops/cd/tf_nndistance.cpp utils/tf_ops/cd/tf_nndistance_g.cu.o -o utils/tf_ops/cd/tf_nndistance_so.so -shared -fPIC -I $(tensorflow) -lcudart -L $(cudalib) -O2 -D_GLIBCXX_USE_CXX11_ABI=0 
utils/tf_ops/cd/tf_nndistance_g.cu.o: utils/tf_ops/cd/tf_nndistance_g.cu
 $(nvcc) -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c -o utils/tf_ops/cd/tf_nndistance_g.cu.o utils/tf_ops/cd/tf_nndistance_g.cu  -I  $(tensorflow) -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2 
 
utils/show_3d/render_balls_so.so: utils/show_3d/render_balls_so.cpp
 g++ -std=c++11 utils/show_3d/render_balls_so.cpp -o utils/show_3d/render_balls_so.so -shared -fPIC -O2 -D_GLIBCXX_USE_CXX11_ABI=0 
utils/tf_ops/emd/tf_auctionmatch_so.so: utils/tf_ops/emd/tf_auctionmatch_g.cu.o utils/tf_ops/emd/tf_auctionmatch.cpp
 g++ -std=c++11 utils/tf_ops/emd/tf_auctionmatch.cpp utils/tf_ops/emd/tf_auctionmatch_g.cu.o -o utils/tf_ops/emd/tf_auctionmatch_so.so -shared -fPIC -I $(tensorflow) -lcudart -L $(cudalib) -O2 -D_GLIBCXX_USE_CXX11_ABI=0 
utils/tf_ops/emd/tf_auctionmatch_g.cu.o: utils/tf_ops/emd/tf_auctionmatch_g.cu
 $(nvcc) -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c -o utils/tf_ops/emd/tf_auctionmatch_g.cu.o utils/tf_ops/emd/tf_auctionmatch_g.cu -I $(tensorflow) -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2 -arch=sm_30 

求救大神该怎么改呀

https://github.com/CharlesShang/TFFRCNN/issues/108#issuecomment-360787661

还有那个“\”是换行连接符,如果你代码在同一行就不需要加这个

我这个应该改哪里呢,我按照那个改的,现在直接makefile:15: *** missing separator. Stop.这样了


缺少分割符,是不是少打了个空格

我这个应该加在哪一行呀 $(nvcc)那一行吗

/usr/bin/ld: cannot find -ltensorflow_framework

collect2: error: ld returned 1 exit status

改之后报这个错

http://kmanong.top/kmn/qxw/form/home?top_cate=28&s=cd