yiranran / Audio-driven-TalkingFace-HeadPose

Code for "Audio-driven Talking Face Video Generation with Learning-based Personalized Head Pose" (Arxiv 2020) and "Predicting Personalized Head Movement From Short Video and Speech Signal" (TMM 2022)
https://ieeexplore.ieee.org/document/9894719
721 stars 146 forks source link

Can't find op.h file when trying to run locally as well as in the Google Colab demo #51

Closed jordanfranklin1 closed 3 years ago

jordanfranklin1 commented 3 years ago

I am up to the part to construct the 3D face reconstruction (step iii in readme, Build tf_mesh_renderer step in the Google Colab demo). I am trying to run this codeblock from the Google Colab demo and it failed. Here is the output:

rasterize_triangles_grad.cc:18:10: fatal error: tensorflow/core/framework/op.h: No such file or directory
 #include "tensorflow/core/framework/op.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
rasterize_triangles_op.cc:19:10: fatal error: tensorflow/core/framework/op.h: No such file or directory
 #include "tensorflow/core/framework/op.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I tried looking in the tensorflow/core/framework part of the path and the op.h file was nowhere to be found. The closest thing to that is op_def_pb2.py.

Here is the original code in that codeblock from the Colab demo:

!cp /usr/local/lib/python3.6/dist-packages/tensorflow/libtensorflow_framework.so.1 /usr/lib/
!cd /usr/lib/ && ln -s libtensorflow_framework.so.1 libtensorflow_framework.so
!cd Deep3DFaceReconstruction/tf_mesh_renderer/mesh_renderer/kernels/;\
  g++ -std=c++11 -shared rasterize_triangles_grad.cc rasterize_triangles_op.cc rasterize_triangles_impl.cc rasterize_triangles_impl.h -o rasterize_triangles_kernel.so -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -I /usr/local/lib/python3.6/dist-packages/tensorflow/include -I /usr/local/lib/python3.6/dist-packages/tensorflow/include/external/nsync/public -L /usr/local/lib/python3.6/dist-packages/tensorflow -ltensorflow_framework -O2

I am using Ubuntu 20.04.2.0 LTS through VirtualBox, Python 3.8, and Miniconda3. I am using pip to install packages and pip installs them in site-packages instead of dist-packages. There is a /usr/lib/local/python3.8/dist-packages path but the dist-packages directory is empty.

I was able to create the symbolic link from the first 2 commands, however, I had to use libtensorflow_framework.so.2. The original code from the Colab demo specified for libtensorflow_framework.so.1 but that file was nowhere to be found. Only libtensorflow_framework.so.2 was there.

!cp /home/miniconda3/lib/python3.8/site-packages/tensorflow/libtensorflow_framework.so.2 /home/miniconda3/lib/
!cd /home/miniconda3/lib/ && ln -s libtensorflow_framework.so.2 libtensorflow_framework.so
!cd Deep3DFaceReconstruction/tf_mesh_renderer/mesh_renderer/kernels/;\
  g++ -std=c++11 -shared rasterize_triangles_grad.cc rasterize_triangles_op.cc rasterize_triangles_impl.cc rasterize_triangles_impl.h -o rasterize_triangles_kernel.so -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -I /home/miniconda3/lib/python3.8/site-packages/tensorflow/include -I /home/miniconda3/lib/python3.8/site-packages/tensorflow/include/external/nsync/public -L /home/miniconda3/lib/python3.8/site-packages/tensorflow/ -ltensorflow_framework -O2

Anyone have an idea of what happened and/or where the op.h file is?

TejaswiniiB commented 2 years ago

Hi @jordanfranklin1 , I too am facing the same issue. Can you tell me how you solved it in local system?