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
Python F./tensorflow/core/util/cuda_launch_config.h:127]检查失败:工作元素计数>;0(0对0)_Python_Tensorflow_Keras - Fatal编程技术网

Python F./tensorflow/core/util/cuda_launch_config.h:127]检查失败:工作元素计数>;0(0对0)

Python F./tensorflow/core/util/cuda_launch_config.h:127]检查失败:工作元素计数>;0(0对0),python,tensorflow,keras,Python,Tensorflow,Keras,我的计算机有两个GPU,如果我不在上下文中添加这些代码,这是正常的 model = keras.utils.training_utils.multi_gpu_model(base_model, gpus=2) 但它将只使用一个来计算,我不明白它是什么意思“work\u element\u count>0”。是不是我以前没有清理过cuda 我尝试了一些方法,减少了批量大小,添加了以下代码: with tf.device('/cpu:0'): model = keras.utils.trai

我的计算机有两个GPU,如果我不在上下文中添加这些代码,这是正常的

model = keras.utils.training_utils.multi_gpu_model(base_model, gpus=2)
但它将只使用一个来计算,我不明白它是什么意思“work\u element\u count>0”。是不是我以前没有清理过cuda

我尝试了一些方法,减少了批量大小,添加了以下代码:

with tf.device('/cpu:0'):
   model = keras.utils.training_utils.multi_gpu_model(base_model, gpus=2)
tensorflow基本源代码文件“python3.6/site packages/tensorflow/include/tensorflow/core/util/cuda_launch_config.h”中出现错误消息“work_element_count>0”


但他们似乎没有效果,任何帮助都将非常感谢

你能澄清你的问题吗?在哪里会出现
工作元素计数>0
的行?很抱歉,我没有清楚地解释这个问题。”在tensorflow源代码文件“python3.6/site packages/tensorflow/include/tensorflow/core/util/cuda_launch_config.h'@PJ.jav”中出现“work_element_count>0”?我也有同样的问题。
// Calculate the Cuda launch config we should use for a kernel launch.
// This is assuming the kernel is quite simple and will largely be
// memory-limited.
// REQUIRES: work_element_count > 0.
inline CudaLaunchConfig GetCudaLaunchConfig(int work_element_count,
                                            const Eigen::GpuDevice& d) {
  CHECK_GT(work_element_count, 0);
  CudaLaunchConfig config;
  const int virtual_thread_count = work_element_count;
  const int physical_thread_count = std::min(
      d.getNumCudaMultiProcessors() * d.maxCudaThreadsPerMultiProcessor(),
      virtual_thread_count);
  const int thread_per_block = std::min(1024, d.maxCudaThreadsPerBlock());
  const int block_count =
      std::min(DivUp(physical_thread_count, thread_per_block),
               d.getNumCudaMultiProcessors());

  config.virtual_thread_count = virtual_thread_count;
  config.thread_per_block = thread_per_block;
  config.block_count = block_count;
  return config;
}