Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: tensorflow/cc/ops/array_ops.h: No such file or directory #40

Closed
lucasjinreal opened this issue Dec 18, 2017 · 7 comments
Closed

Comments

@lucasjinreal
Copy link

lucasjinreal commented Dec 18, 2017

Hi, thanks for this very convenient way to compile tensorflow C++ library repo. I successfully build tensorflow static which is the default option. But when I build example, it says this error:

/usr/local/include/tensorflow/tensorflow/cc/ops/standard_ops.h:19:41: fatal error: tensorflow/cc/ops/array_ops.h: No such file or directory
compilation terminated.

The codes are simply the example, I paste my CMakeLists.txt here for investigation:

find_package(TensorflowCC REQUIRED)
include_directories(TensorflowCC_INCLUDE)
if (TensorflowCC_FOUND)
    message(STATUS "We just found TensorFlow CC!!!!!!!")
endif ()

target_link_libraries(main ${OpenCV_LIBS} TensorflowCC::Static)

Any suggestion will be many appreciated!!!!!

@FloopCZ
Copy link
Owner

FloopCZ commented Dec 19, 2017

Hi, what example are you building? You probably need to build the shared library instead of the static library. The static library is kind of limited to provide just enough functionality for the inference using an existing network.

Also you don't need include_directories(TensorflowCC_INCLUDE) in your CMakeLists.txt, that one is taken care of by the TensorflowCC::* targets.

@FloopCZ
Copy link
Owner

FloopCZ commented Jan 19, 2018

Closing for inactivity.

@FloopCZ FloopCZ closed this as completed Jan 19, 2018
@dubslow
Copy link

dubslow commented May 19, 2018

I'm getting something similar with the static build. Trying to build a semi-experimental tf-based network evaluation backend (no training). Looks like a header in tf_cc references this header, which isn't itself included.

g++ -Ilc0@exe -I. -I../.. -I../../src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O0 -g -Wextra -pedantic -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/gen/host_obj/ -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/gen/host_obj/ -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/gen/protobuf-host/include -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/gen/protobuf-host/include -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads/nsync/public -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads/nsync/public -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads/gemmlowp -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads/gemmlowp -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads/eigen -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads/eigen -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads -isystem /usr/local/include/tensorflow/tensorflow/contrib/makefile/downloads -isystem /usr/local/include/tensorflow -isystem /usr/local/include/tensorflow  -MD -MQ 'lc0@exe/src_neural_network_tf.cc.o' -MF 'lc0@exe/src_neural_network_tf.cc.o.d' -o 'lc0@exe/src_neural_network_tf.cc.o' -c ../../src/neural/network_tf.cc
In file included from ../../src/neural/network_tf.cc:25:0:
/usr/local/include/tensorflow/tensorflow/cc/ops/standard_ops.h:19:41: fatal error: tensorflow/cc/ops/array_ops.h: No such file or directory
 #include "tensorflow/cc/ops/array_ops.h"
                                         ^
compilation terminated.
bill@Gravemind ~/leela/lc0 $ locate array_ops.h
# file doesn't exist indeed
bill@Gravemind ~/leela/lc0 $ locate standard_ops.h
/home/bill/tensorflow_cc/tensorflow_cc/build/tensorflow/tensorflow/cc/ops/standard_ops.h
/usr/local/include/tensorflow/tensorflow/cc/ops/standard_ops.h

@FloopCZ
Copy link
Owner

FloopCZ commented May 19, 2018

Hi, have you tried the shared library version? The static library is very limited.

@dubslow
Copy link

dubslow commented May 19, 2018

There should be a difference between "limited" and "internally consistent".

No I haven't tried the dynamic build, it seemed like substantially more investment of time and disk space. Maybe I'll come back to it in the future, but in the short-term I'm not especially interested in getting the TF backend to work (currently focusing on porting the BLAS backend that exists elsewhere).

Having said that, I'd still be happy to provide debugging assistance here. I'm hoping that merely some cmake setting can be tweaked to include the proper dependencies of standard_ops.h (either that, or standard_ops.h itself shouldn't be included in the static build).

@FloopCZ
Copy link
Owner

FloopCZ commented May 19, 2018

Sure, unfortunately, that is not something I decide. The static library is just built using tensorflow/contrib/makefile, so unless this is changed upstream, there is not much I could do about it.

If you don't require CUDA, than the shared library is not much bigger than the static one and the only thing you need to do extra is to install Bazel (or use Docker). See the sizes of the docker images (note that those include the full operating system including CUDA):
https://hub.docker.com/r/floopcz/tensorflow_cc/tags/

@dubslow
Copy link

dubslow commented May 19, 2018

Ah, sorry for that misunderstanding on my part.

That's not bad. Maybe I'll come back to it soon!

Thanks for the very quick replies, especially on such a busy repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants