当 运行 Bazel 时,我应该在哪里保存 Tensorflow 的 .pb 图?

When running with Bazel, where should I save .pb graphs for Tensorflow?

目录结构:

~/tensorflow/tensorflow/cc/dnnops/
├── BUILD
├── graph.pb
└── main.cc

来自 main.cc 的失败代码行:status = ReadBinaryProto(tf::Env::Default(), "graph.pb", &graph_def);。可以找到完整代码 here.

Bazel 输出:

WARNING: /home//.cache/bazel/_bazel_rd1/4ab077b6e1a2076b6ea9f23b417088a6/external/protobuf_archive/WORKSPACE:1: Workspace name in /home//.cache/bazel/bazel/4ab077b6e1a2076b6ea9f23b417088a6/external/protobuf_archive/WORKSPACE (@com_google_protobuf) does not match the name given in the repository's definition (@protobuf_archive); this will cause a build error in future versions INFO: Analysed target //tensorflow/cc/dnnops:dnnops (0 packages loaded). INFO: Found 1 target... Target //tensorflow/cc/dnnops:dnnops up-to-date: bazel-bin/tensorflow/cc/dnnops/dnnops INFO: Elapsed time: 5.378s, Critical Path: 5.04s INFO: 2 processes, local. INFO: Build completed successfully, 3 total actions

INFO: Running command line: bazel-bin/tensorflow/cc/dnnops/dnnops Not found: graph.pb; No such file or directory ERROR: Non-zero return code '1' from command: Process exited with status 1

我试过的

复制 bazel-bin/tensorflow/cc/dnnops 中的同一个图表文件。 Bazel 的相同输出仍然失败。

问题

我应该如何将图形文件位置公开给 Tensorflow/Bazel?

愚蠢的疏忽...我输入了完整路径。来自:

status = ReadBinaryProto(tf::Env::Default(), "graph.pb", &graph_def);

为此:

status = ReadBinaryProto(tf::Env::Default(), "/home/<user>/path/to/graph.pb", &graph_def);