从源代码安装 Tensorflow
Installing Tensorflow from source
过去几天我一直在尝试安装 Tensorflow 并使其正常运行。虽然我已经设法安装 TF 并通过在终端中打开 Python 并输入来使其按测试工作,
import tensorflow as tf
我没有成功尝试重新训练 Inception v3。我按照 here 中的说明设法从源代码安装了一次,但是我不能再这样做了。当我到达 'Create the pip package and install' 部分并转到 Tensorflow 目录根目录中的 运行 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
我觉得你问之前先搜索一下,This link大概可以解决你的问题。
问题在于./configure的使用不正确。虽然它是 运行 我目前在我的计算机上有两个版本的 python ,它们都存储在不同的位置,当 运行 ./configure 我将它指向错误的 python 版本。纠正问题后一切正常。
过去几天我一直在尝试安装 Tensorflow 并使其正常运行。虽然我已经设法安装 TF 并通过在终端中打开 Python 并输入来使其按测试工作,
import tensorflow as tf
我没有成功尝试重新训练 Inception v3。我按照 here 中的说明设法从源代码安装了一次,但是我不能再这样做了。当我到达 'Create the pip package and install' 部分并转到 Tensorflow 目录根目录中的 运行 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
我觉得你问之前先搜索一下,This link大概可以解决你的问题。
问题在于./configure的使用不正确。虽然它是 运行 我目前在我的计算机上有两个版本的 python ,它们都存储在不同的位置,当 运行 ./configure 我将它指向错误的 python 版本。纠正问题后一切正常。