Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
bazel run不会加载在bazel构建时加载的所有tensorflow包 我在重新启动ubuntu .t/p>之后,直接运行了我的C++ TysFROUP应用程序。_C++_Tensorflow_Bazel - Fatal编程技术网

bazel run不会加载在bazel构建时加载的所有tensorflow包 我在重新启动ubuntu .t/p>之后,直接运行了我的C++ TysFROUP应用程序。

bazel run不会加载在bazel构建时加载的所有tensorflow包 我在重新启动ubuntu .t/p>之后,直接运行了我的C++ TysFROUP应用程序。,c++,tensorflow,bazel,C++,Tensorflow,Bazel,通常我是通过bazel构建应用程序的 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

通常我是通过bazel构建应用程序的

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运行之前执行时,加载包是正确的。 有没有一种方法可以只加载丢失的包而不提前构建?我需要运行应用程序后立即启动,但我的建设过程是长期建设之前运行应用程序

解决方案:

启用gpu选项。允许gpu增长是否解决了问题


非常感谢。设置\u允许\u增长为True可解决此问题。
SessionOptions opts;
opts.config.mutable_gpu_options()->set_allow_growth(true);
session->reset(tensorflow::NewSession(opts));