从源安装Tensorflow

时间:2016-10-24 15:35:59

标签: neural-network tensorflow conv-neural-network

我一直在尝试安装Tensorflow并在过去几天内让它运行起来。虽然我已经设法安装TF并通过在终端中打开Python并打字来测试它的工作情况, import tensorflow as tf 我没有成功尝试重新训练初始v3。我设法按照here列出的说明从源代码安装它,但我无法再这样做了。当我进入“创建pip包并安装”部分并在我的Tensorflow directiory的根目录中运行bazel build -c opt //tensorflow/tools/pip_package:build_pip_package时,我收到以下错误。

kieran@kieranUbuntu:~/tensorflow$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: /home/kieran/tensorflow/tensorflow/core/BUILD:1068:1: no such target '//tensorflow/tools/git:gen/spec.json': target 'gen/spec.json' not declared in package 'tensorflow/tools/git' defined by /home/kieran/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /home/kieran/tensorflow/tensorflow/core/BUILD:1068:1: no such target '//tensorflow/tools/git:gen/head': target 'gen/head' not declared in package 'tensorflow/tools/git' defined by /home/kieran/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /home/kieran/tensorflow/tensorflow/core/BUILD:1068:1: no such target '//tensorflow/tools/git:gen/branch_ref': target 'gen/branch_ref' not declared in package 'tensorflow/tools/git' defined by /home/kieran/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
INFO: Elapsed time: 3.063s

当我设法安装它然后尝试在this教程之后保留分类器时,遇到了同样的错误。在bazel build tensorflow/examples/image_retraining:retrain部分。 我无法弄清楚出了什么问题,而且我一直在努力。

我正在使用这个pip版本,#Ubuntu / Linux 64位,仅限CPU,Python 2.7

2 个答案:

答案 0 :(得分:0)

我认为你应该在问之前进行搜索,This link可以解决你的问题。

答案 1 :(得分:0)

问题在于错误使用./configure。虽然它已经运行,但我目前在我的计算机上有两个版本的python,两个版本都存储在不同的位置,运行时./configure我指向错误的python版本。纠正问题后,一切正常。