为了评估MMD,断断续续装了4天,踩了几乎所有的坑,终于装上了QAQ
1. 库链接:pointnet-autoencoder/tf_ops/nn_distance at master · charlesq34/pointnet-autoencoder · GitHub
2. 安装TensorFlow,我的环境是cuda 11.5 ,python 3.7,所以我装TensorFlow 1.15.0,要用conda,不要用pip,原因是还要安装其他的东西:conda install tensorflow==1.15.0
3. 如果遇到 cannot find -ltensorflow_framework:
找到 /data/envs/test/lib/python3.7/site-packages/tensorflow_core
(我这里地址是tensorflow_core,也可能是tensorflow),输入
ln -s libtensorflow_framework.so.1 libtensorflow_framework.so
4. 修改 tf_nndistance_compile.sh
/usr/local/cuda-11.5/bin/nvcc tf_nndistance_g.cu -o tf_nndistance_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
g++ -std=c++11 tf_nndistance.cpp tf_nndistance_g.cu.o -o tf_nndistance_so.so -shared -fPIC -I /data/envs/test/lib/python3.7/site-packages/tensorflow_core/include -I /usr/local/cuda-11.5/include -I /data/envs/test/lib/python3.7/site-packages/tensorflow_core/include/external/nsync/public -lcudart -L /usr/local/cuda-11.5/lib64/ -L/data/envs/test/lib/python3.7/site-packages/tensorflow_core -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=1
5. 如果遇到 undefined symbol: _ZN10tensorflow12OpDefBuilder5InputESs
看这个链接:Error in running rendering_example.py : undefined symbol: _ZN10tensorflow12OpDefBuilder5InputESs · Issue #54 · tranluan/Nonlinear_Face_3DMM · GitHub6. 问题5如果解决不了,就用CPU版本,不用GPU版本了
真的好难安QAQ