bazel-run不会加载在bazel build中加载的所有tensorflow包

问题描述 投票:0回答:1

我在重启ubuntu后直接运行我的c ++ tensorflow应用程序有问题。

通常我通过bazel build构建应用程序

bazel build -c opt --local_resources 3072,4.0,1.0 --verbose_failures --config=monolithic //tensorflow/app/...

在构建之后,当我执行时

bazel-bin/tensorflow/app/run

一切都很完美但是,当我重新启动ubuntu并首先执行bazel-bin时,我发现了这个错误的垃圾邮件。

May 11 12:29:05 tegra-ubuntu start.sh[800]: 2018-05-11 12:29:04.622723: E tensorflow/stream_executor/cuda/cuda_driver.cc:967] failed to alloc 2304 bytes on host: CUDA_ERROR_UNKNOWN
May 11 12:29:05 tegra-ubuntu start.sh[800]: 2018-05-11 12:29:04.622849: E tensorflow/stream_executor/cuda/cuda_driver.cc:967] failed to alloc 2304 bytes on host: CUDA_ERROR_UNKNOWN

我想这是加载包中的问题。当bazel构建在bazel-run之前执行时,加载包是正确的。有一种方法只能在没有早期构建的情况下加载丢失的包吗?我需要在启动后立即运行应用程序,但我的构建过程是在运行应用程序之前要长时间构建


解:

SessionOptions opts;
opts.config.mutable_gpu_options()->set_allow_growth(true);
session->reset(tensorflow::NewSession(opts));
c++ tensorflow bazel
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.