Open DoubleYanLee opened 3 years ago
Hi, the pre-compiled binary file only works if you install tensorflow 1.12 via pip install and use cuda 9.0. If you install tensorflow via conda with other version of cudatoolkit, you have to compile tf_mesh_renderer from source using bazel.
I have tensorflow v=2.5.0, and cuda 9.0 But still this error persists. Please let me know, what else can go wrong!
I have tensorflow v=2.5.0, and cuda 9.0 But still this error persists. Please let me know, what else can go wrong!
Hi, I'm not sure if tensorflow version >= 2.0 can work.
@YuDeng Thank you for the response. I downgraded to the TensorFlow version=1.12 and the demo ran successfully.
@rakaar what version of the cuda and cudnn did you use for TensorFlow==1.12? Can we run it on CPU only without having need for cuda? I use TensorFlow==2.4 and CUDA==11 and ended with a similar problem https://github.com/microsoft/Deep3DFaceReconstruction/issues/139
Can someone provide pre-compiled binary file rasterize_triangles_kernel.so that can work with TensorFlow >= 2.0 ?
@fisakhan It doesn't work with TensorFlow version 2.0, you need to degrade the tensorflow version to 1.12 (ref) And I think CUDA is necessary, I tried running without CUDA, it didn't work.
TF_INC=$(python3 -c "import tensorflow as tf; print(tf.sysconfig.get_include())") TF_LIB=$(python3 -c "import tensorflow as tf; print(tf.sysconfig.get_lib())")
echo "TF_INC: $TF_INC" >&2
echo "TF_LIB: $TF_LIB" >&2
(cd $TF_LIB && ln -sf libtensorflow_framework.so.2 libtensorflow_framework.so)
TF_MESH_RENDERER_PATH=$PWD/tf_mesh_renderer/mesh_renderer/kernels/
g++ -std=c++11 \ -shared \ $TF_MESH_RENDERER_PATH/rasterize_triangles_grad.cc \ $TF_MESH_RENDERER_PATH/rasterize_triangles_op.cc \ $TF_MESH_RENDERER_PATH/rasterize_triangles_impl.cc \ $TF_MESH_RENDERER_PATH/rasterize_triangles_impl.h \ -o $TF_MESH_RENDERER_PATH/rasterize_triangles_kernel.so \ -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 \ -I$TF_INC -L$TF_LIB -ltensorflow_framework -O2
if [ "$?" -ne 0 ]; then echo "compile rasterizer failed"; exit 1; fi
when I run "python demo.py", I get this error, the detail message is:
I suspect the problem is about the file " rasterize_triangles_kernel.so ". I just download the pre-compiled binary file (rasterize_triangles_kernel.so), but I'm sure my tensorflow version is 1.12.
Your help would be highly appreciated.