dlinzhao / JSNet

JSNet: Joint Instance and Semantic Segmentation of 3D Point Clouds, AAAI2020
MIT License
103 stars 17 forks source link

tf_ops compilation and CUDA version #10

Open Vishak66 opened 4 years ago

Vishak66 commented 4 years ago

Hello Lin,

Do I need to compile the .sh scripts under tf_ops first? Kindly advise on how to compile the tf operators.

Also did you test it in a specific cuda/cudnn version?

dlinzhao commented 3 years ago

@Vishak66 The code is tested under TF1.7 GPU version, CUDA 9.0, cudnn 7.0.5 and Python 3.6 on Ubuntu 16.04. There are also some dependencies for a few Python libraries for data processing like h5py etc. It's highly recommended that you have access to GPUs. The TF operators are included under tf_ops, you need to compile them (check tf_xxx_compile.sh under each ops subfolder) first. Update nvcc and python path if necessary. Then, you can compile it by sh tf_xxx_compile.sh.

Daniel22L commented 2 years ago

Hello Lin,

I am trying to compile the tf_xxx_compile.sh. I am working with TF1.4 and Python 3.5, following the JSNet instructions (I am working with the udocker image tensorflow/tensorflow:1.4.0-gpu-py3). When I execute the one in the folder 3d_interpolation I have the following error:

tf_interpolate.cpp:6:37: fatal error: tensorflow/framework/op.h: No such file or directory
compilation terminated.

I have not modified anything beause I have seen that the pointnet++ original file has been modified in JSNet to work with TF1.4.

To see what could be, I have downloaded pointnet++ code. I have try to compile the same file using TF1.2 and Python 3.5 (udocker image tensorflow/tensorflow:1.2.0-gpu-py3). I have got the same error.

Last, I have tried to compile that file (the one in pointnet++, not in JSNet) using TF1.2 and Python 2.7 (udocker image tensorflow/tensorflow:1.2.0-gpu) and it works. Maybe the problem is the python version. However, it is not suitable for working with JSNet, since it uses Python 3.5 and TF1.4.

What am I doing wrong? Do I have to modified any file in the JSNet repository?

dlinzhao commented 2 years ago

@Daniel22L Maybe you should update the path of Tensorflow in each tf_xxx_compile.sh. You can try to modify $HOME/anaconda3/envs/tensorflow_1.4/lib/python3.5/site-packages/tensorflow to /usr/local/lib/python3.5/dist-packages/tensorflow or other correct path.

g++ -std=c++11 tf_interpolate.cpp \
-o tf_interpolate_so.so \
-shared \
-fPIC \
-I$HOME/anaconda3/envs/tensorflow_1.4/lib/python3.5/site-packages/tensorflow/include \
-I/usr/local/cuda-8.0/include \
-I$HOME/anaconda3/envs/tensorflow_1.4/lib/python3.5/site-packages/tensorflow/include/external/nsync/public \
-lcudart \
-L/usr/local/cuda-8.0/lib64/ \
-L$HOME/anaconda3/envs/tensorflow_1.4/lib/python3.5/site-packages/tensorflow \
-ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0