Latent_3d_points复现

指路:
运行latent_3d_points的train_single_class_ae.ipynb
其中重点:
先确定自己的tensorflow路径
新建find.py文件:vim find.py
find.py文件内容:

from __future__ import print_function
import tensorflow as tf
print(tf.sysconfig.get_compile_flags(),'\n')
print(tf.sysconfig.get_link_flags())

输出结果:

['-I/home/xxj/.local/lib/python2.7/site-packages/tensorflow/include', '-D_GLIBCXX_USE_CXX11_ABI=0'] 
['-L/home/xxj/.local/lib/python2.7/site-packages/tensorflow', '-l:libtensorflow_framework.so.1']

4.根据上个步骤的输出结果,修改makefile文件,-I之后的内容为TF_INC,-L之后的内容为TF_LIB。
注意makefile中的D_GLIBCXX_USE_CXX11_ABI等于0还是1,以及-l:libtensorflow_framework.so.1,这两部分都需对应自己上一步的输出。

nvcc=/usr/local/cuda-8.0/bin/nvcc
cudalib=/usr/local/cuda-8.0/lib64
nsync=/home/xxj/.local/lib/python2.7/site-packages/tensorflow/include/external/nsync/public
TF_INC=/home/xxj/.local/lib/python2.7/site-packages/tensorflow/include
TF_LIB=/home/xxj/.local/lib/python2.7/site-packages/tensorflow

all: tf_approxmatch_so.so tf_approxmatch_g.cu.o tf_nndistance_so.so tf_nndistance_g.cu.o

tf_approxmatch_so.so: tf_approxmatch_g.cu.o tf_approxmatch.cp
       g++ -std=c++11 tf_approxmatch.cpp tf_approxmatch_g.cu.o -o tf_approxmatch_so.so -shared -fPIC -I $(TF_INC) -I $(nsync) -lcudart -L $(cudalib) -L $(TF_LIB) -l:libtensorflow_framework.so.1 -O2 -D_GLIBCXX_USE_CXX11_ABI=0

tf_approxmatch_g.cu.o: tf_approxmatch_g.cu
       $(nvcc) -std=c++11 -c -o tf_approxmatch_g.cu.o tf_approxmatch_g.cu -I $(TF_INC) -I $(nsync) -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2 -D_GLIBCXX_USE_CXX11_ABI=0

tf_nndistance_so.so: tf_nndistance_g.cu.o tf_nndistance.cpp
       g++ -std=c++11 tf_nndistance.cpp tf_nndistance_g.cu.o -o tf_nndistance_so.so -shared -fPIC -I $(TF_INC) -I $(nsync) -lcudart -L $(cudalib) -L $(TF_LIB) -l:libtensorflow_framework.so.1 -O2 -D_GLIBCXX_USE_CXX11_ABI=0

tf_nndistance_g.cu.o: tf_nndistance_g.cu
       $(nvcc) -std=c++11 -c -o tf_nndistance_g.cu.o tf_nndistance_g.cu -I $(TF_INC) -I $(nsync) -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2 -D_GLIBCXX_USE_CXX11_ABI=0

clean:
       rm tf_approxmatch_so.so
       rm tf_nndistance_so.so
       rm  *.cu.o

————————————————
版权声明:本文为CSDN博主「谦虚的海绵」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_25436597/article/details/102708842

我的是这样:

nvcc = /usr/local/cuda-8.0/bin/nvcc
cudalib =  /usr/local/cuda-8.0/lib64
nsync = /home/y/.local/lib/python2.7/site-packages/tensorflow/include/external
TF_INC=/home/y/.local/lib/python2.7/site-packages/tensorflow/include
TF_LIB=/home/y/.local/lib/python2.7/site-packages/tensorflow

all: tf_approxmatch_so.so tf_approxmatch_g.cu.o tf_nndistance_so.so tf_nndistance_g.cu.o

tf_approxmatch_so.so: tf_approxmatch_g.cu.o tf_approxmatch.cpp	
	g++ -std=c++11 tf_approxmatch.cpp tf_approxmatch_g.cu.o -o tf_approxmatch_so.so -shared -fPIC -I $(TF_INC) -I $(nsync) -lcudart -L $(cudalib) -L $(TF_LIB) -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0
tf_approxmatch_g.cu.o: tf_approxmatch_g.cu
	 $(nvcc) -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c -o tf_approxmatch_g.cu.o tf_approxmatch_g.cu -I $(TF_INC) -I $(nsync) -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2
tf_nndistance_so.so: tf_nndistance_g.cu.o tf_nndistance.cpp
	 g++ -std=c++11 tf_nndistance.cpp tf_nndistance_g.cu.o -o tf_nndistance_so.so -shared -fPIC -I $(TF_INC) -I $(nsync) -lcudart -L $(cudalib) -L $(TF_LIB) -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0
tf_nndistance_g.cu.o: tf_nndistance_g.cu
	 $(nvcc) -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c -o tf_nndistance_g.cu.o tf_nndistance_g.cu -I $(TF_INC) -I $(nsync) -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2
	 
clean:
	 rm tf_approxmatch_so.so
	 rm tf_nndistance_so.so
	 rm  *.cu.o 

makefile文件在Latent/external/structural_losses/makefile这个路径下面

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值