如何结合来自 tensorflow tensorflow-serving 和 syntaxnet 的 bazel 工件?

How to combine bazel artifacts from tensorflow tensorflow-serving and syntaxnet?

我已经使用 bazel 构建了 syntaxnet 和 tensorflow-serving。两者都嵌入了自己的(部分?)tensorflow 本身的副本。我已经遇到问题,我想 "import" 脚本中的 tensorflow-serving 的某些部分 "lives" 在 syntaxnet 树中我无法弄清楚(没有做一些非常丑陋的事情) .

现在我想要 "tensorboard",但这显然不是作为 syntaxnet 或 tensorflow-serving 内的嵌入式 tensorflow 的一部分构建的。

所以现在我确定 "I'm doing it wrong"。我应该如何组合由各种单独的 bazel 工作区构建的工件?

特别是,我如何构建 tensorflow(使用 tensorboard)AND syntaxnet 和 tensorflow-serving 并让它们 "installed" 使用,这样我就可以开始在一个完全独立的 directory/repository 中编写自己的脚本?

“./bazel-bin/blah”真的是 bazel 的终结者吗?没有"make install"等价物?

你说得对,目前 Tensorboard 目标仅在 Tensorflow 存储库中公开,而其他两个使用它的目标未公开。这意味着要实际启动 Tensorboard,您需要自己检查 Tensorflow 并在那里 compile/run Tensorboard(将其指向生成的 logdir)。

实际上在日志目录中生成训练摘要数据是在训练期间完成的,在您的例子中是在 tensorflow/models 存储库中。 inception_train.py中好像用到了SummaryWriter,或许你可以添加一些类似syntaxnet的东西。如果这不起作用并且您无法 link Tensorboard,我建议您在 tensorflow/models 中提交问题以在其中添加对 Tensorboard 的支持。你不应该在 Tensorflow Serving 中需要 Tensorboard。

在 syntaxnet 中导入 Tensorflow Serving 的部分内容需要您将这个新的依赖项添加为子模块(就像在 tensorflow 中所做的那样)或者可能 git_repository 在 WORKSPACE 文件中添加,如果可行的话。我们从未尝试过此操作,因此对于这个未经测试的用例,可能存在某些问题。如果您遇到此问题,请提出问题。

至于仅安装 运行,Tensorflow Serving 目前不支持。这是一组库,您可以 link 直接将其放入服务器二进制文件并进行编译(存储库提供了一些示例服务器和客户端),但现在没有简单的 "installed server"。然而,Tensorflow 和 Tensorboard 可以从任何地方安装和 linked。