Tensorflow和Bazel C ++ [英] Tensorflow and Bazel c++

查看:317
本文介绍了Tensorflow和Bazel C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从源代码构建tensorflow C ++,但没有成功.我遵循了不同的教程,但是每次都会有不同的错误.

I'm trying to build tensorflow C++ from sources but no success. I followed different tutorials, but each time, there is a different error.

我想做的是创建一个库,以便可以在Qt中使用它.我遵循了本教程,因为这正是我想要的: https://tuatini.me/building-tensorflow-as-a-standalone -项目/ (在Ubuntu上构建,而不是在树莓派上构建)

What I want to do is to create a library so I can use it with Qt. I followed this tutorial because it was exactly what I wanted: https://tuatini.me/building-tensorflow-as-a-standalone-project/ (build on Ubuntu, not on raspberry)

在我必须使用babel之前,它工作正常. 本教程说我必须运行以下命令: bazel build -c opt --verbose_failures //tensorflow:libtensorflow_cc.so

It works fine until I have to use babel. The tutorial says I have to run this command: bazel build -c opt --verbose_failures //tensorflow:libtensorflow_cc.so

,但始终会失败并显示以下错误: ERROR: /home/default/.cache/bazel/_bazel_default/045e1c5e9b482c7b029d706e128fc7e7/external/io_bazel_rules_closure/closure/stylesheets/closure_css_library.bzl:27:13: name 'set' is not defined

but it always fails with the error: ERROR: /home/default/.cache/bazel/_bazel_default/045e1c5e9b482c7b029d706e128fc7e7/external/io_bazel_rules_closure/closure/stylesheets/closure_css_library.bzl:27:13: name 'set' is not defined

我不知道应该在哪里定义设置"(我删除了.cache/bazel文件夹)

I have no idea where I'm supposed to define 'set' (I remove the .cache/bazel folder)

我遵循的其他教程给了我类似bazel needs to be > 0.4.3, found 0.13.1的错误,好像它是字符串而不是数字...

Other tutorials I followed gave me errors such as bazel needs to be > 0.4.3, found 0.13.1 as if it was strings instead of numbers...

关于如何使其工作的任何想法?

Any idea on how to make it work?

推荐答案

您是否需要构建Tensorflow 1.3.0?根据教程,有一个旧版本的TF只能用Bazel 0.5.1构建.您拥有Bazel 0.13.1,它在构建脚本中不支持关键字set. Bazel 0.13.1可以构建最新版本的TF.

Do you need to build Tensorflow 1.3.0? There's an old version of TF that can only be built with Bazel 0.5.1, according to the tutorial. You have Bazel 0.13.1, which doesn't support the keyword set in the build scripts. The latest version of TF is buildable with Bazel 0.13.1.

如果您需要构建1.3.0,请从 https://github.com/bazelbuild/bazel/tags?before=0.4.3 .

If you need to build 1.3.0, install an older version of Bazel (e.g. 0.5.4) from https://github.com/bazelbuild/bazel/tags?before=0.4.3.

确切地说,此错误来自TF的一种依赖关系,而不是TF本身.

To be exact, this error comes from one of the dependencies of TF, and not TF itself.

这篇关于Tensorflow和Bazel C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆