Comments (1)
I had the same issue and isolated the problem by creating a test file in the same directory as the losses, latent_3d_points/external/structural_losses:
import tensorflow as tf
nn_distance_module = tf.load_op_library('./tf_nndistance_so.so')
Running this gave the error: NotFoundError: undefined symbol: _ZTIN10tensorflow8OpKernelE
It seems to be essentially caused by my versions of CUDA and Tensorflow being newer than the one the author tested on (mine are 9.0 and 1.11.0), These helped me solve the problem: these answers, Tensorflow's guide, and this answer.
I could not use the solutions given in the above articles directly because for some reason my system (Linux Ubuntu 16.04 LTS) would give the error "No such file or directory" for ${TF_CFLAGS[@]}
and ${TF_LFLAGS[@]}
. It needs the space afer-L
and -I
. Here's how I fixed it:
First I checked the outputs of:
import tensorflow as tf
from __future__ import print_function
print(tf.sysconfig.get_compile_flags(),'\n')
print(tf.sysconfig.get_link_flags())
which for me was
['-I/usr/local/lib/python2.7/dist-packages/tensorflow/include', '-I/usr/local/lib/python2.7/dist-packages/tensorflow/include/external/nsync/public', '-D_GLIBCXX_USE_CXX11_ABI=1']
['-L/usr/local/lib/python2.7/dist-packages/tensorflow', '-ltensorflow_framework']
I manually replaced what was -I $(tensorflow)
with the stuff from the first line, added the stuff from the second line to the g++ commands, and changed -D_GLIBCXX_USE_CXX11_ABI=0
to -D_GLIBCXX_USE_CXX11_ABI=1
. My working makefile is:
nvcc=/usr/local/cuda-9.0/bin/nvcc
cudalib=/usr/local/cuda-9.0/lib64
nsync=/usr/local/lib/python2.7/dist-packages/tensorflow/include/external/nsync/public
TF_INC=/usr/local/lib/python2.7/dist-packages/tensorflow/include
TF_LIB=/usr/local/lib/python2.7/dist-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=1
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=1
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=1
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=1
clean:
rm tf_approxmatch_so.so
rm tf_nndistance_so.so
rm *.cu.o
After re-compiling the losses, everything works.
from latent_3d_points.
Related Issues (20)
- 'approx_match' is not defined? HOT 2
- No module named latend_3d_points.src.ae_templates HOT 4
- Training my own data
- Training my own data
- Question about SVM training. HOT 4
- The original shapenetcore dataset HOT 3
- Info on clock time per epoch (approximately)
- Where can I get modelnet10 dataset in xyz format
- tf_nndistance_so.so: undefined symbol: __cudaRegisterFunction HOT 1
- How can I download your dataset?
- How to use D-FAUST database?
- train_single_class_ae.py : IndexError: list index out of range HOT 2
- EMD code
- Cannot compile the EMD/Chamfer losses HOT 1
- [AD] Yet another EMD implementation for dense point clouds HOT 1
- Cannot compile EMD makefile on Google Colab HOT 1
- Running on GPU HOT 1
- Any pytorch implementation available
- NameError: name 'raw_input' is not defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from latent_3d_points.