cjweeks / tensorflow-cmake

Integrate TensorFlow with CMake projects effortlessly
MIT License
331 stars 81 forks source link

unable to install Eigen and Protobuf in step 2 #8

Closed minditar closed 7 years ago

minditar commented 7 years ago

Thank you so much for the tensorflow-cmake project you create. I download the Eigen source code eigen-eigen-f562a193118d.tar.gz, decompression it and put it under the directory /home/minditar/tensorflow. Then use the command sudo bash eigen.sh install /home/minditar/tensorflow then error occurs like: Finding Eigen version in /home/minditar/tensorflow using method 0... Finding Eigen version in /home/minditar/tensorflow using method 1... Finding Eigen version in /home/minditar/tensorflow using method 2... Failure: could not find Eigen version in /home/minditar/tensorflow

I follow the pattern sudo eigen.sh install <tensorflow-root> [<install-dir> <download-dir>]to change the command into the followings: sudo bash eigen.sh install '/home/minditar/tensorflow' '/home/minditar/tensorflow/eigen-eigen-f562a193118d' sudo bash eigen.sh install '/home/minditar/tensorflow' '/usr/local' '/home/minditar/tensorflow/eigen-eigen-f562a193118d' sudo bash eigen.sh install '/home/minditar/tensorflow' '/home/minditar/tensorflow/eigen-eigen-f562a193118d/Eigen' sudo bash eigen.sh install '/home/minditar/tensorflow' '/usr/local' '/home/minditar/tensorflow/eigen-eigen-f562a193118d/Eigen' They all throw the same error like the above and can not find the Eigen. While I actually put it under the directory. While I also don't know how to figure out the version of Eigen and Protobuf the current tensorflow code needs.

cjweeks commented 7 years ago

Hello, and thank you for your question. If all things function as expected, you should never need to manually download Eigen; this is the goal of eigen.sh. The <tensorflow-root> directory required by the script is the root directory of the TensorFlow repository itself. Therefore, all you need to do is clone the TensorFlow repository into some directory and pass that directory into your eigen.sh.

For example, let's say I clone Tensorflow inside /home/cjweeks/git; this will create a /home/cjweeks/git/tensorflow directory which contains the new repository. To call the install script, simply provided it with this location: sudo ./eigen.sh install /home/cjweeks/git/tensorflow [other-options-here]. The same process can be followed for Protobuf.

You never have to determine which versions of Eigen and Protobuf TensorFlow uses; the scripts do that for you. All you need is the TensorFlow repository for the scripts to reference.

In review, the arguments for eigen.sh in the install configuration are as follows:

If you have any more questions, do not hesitate to post here!

minditar commented 7 years ago

I try the method you provide again used the command ./protobuf.sh install '/home/minditar/tensorflow' and still get the error, Failure: Could not find all required strings in /home/minditar/tensorflow

When I use old version of tensorflow like tensorflow-0.9.0.zip, the error changes to Command failed - script terminated

cjweeks commented 7 years ago

The first problem is strange; when I pull the latest version of TensorFlow and execute the script with similar parameters, it proceeds with no errors:

tensorflow-cmake_issue8_1

What is contained in your /home/minditar/tensorflow directory? This should be the TensorFlow root directory, and should have contents similar to the following:

tensorflow-cmake_issue8_2

Is this what the directory structure looks like? Additionally, these scripts will not work correctly with older versions of TensorFlow, as TensorFlow has changed the way it formats some dependencies.

Additionally, does eigen.sh work with your current configuration now?

minditar commented 7 years ago

I downloaded the tensorflow-0.12.0.zip file from https://github.com/tensorflow/tensorflow/releases rather than use files in https://github.com/tensorflow/tensorflow page. And I compile the source code again. Using the command you provide, it works now. The difference that can be easily known is that the site https://github.com/tensorflow/tensorflow doesn't includejpeg.BUILD file. Maybe there are more differences between the files in the two sites. And the new version of tensorflow doesn't have avro in its third_party packages. So you may need small change on the introduction page. Thanks so much for your help. At last, the problem is not caused by your project or command while due to unknown reasons related to tensorflow.

cjweeks commented 7 years ago

Thank you for the information; I will look into the possible release differences. I have also slightly altered the instructions for removing the specified third-party directories as you indicated. I am closing this issue for now, but if you have any more questions, you may re-open it or open a new issue.

lawsonfulton commented 6 years ago

I also ran into this problem.

The solution I found was to replace the line in eigen.sh ARCHIVE_HEADER="native.new_http_archive\(\s*" with ARCHIVE_HEADER="tf_http_archive\(\s*"