TF报错:CUDA_ERROE_OUT_OF_MEMORY

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tengxing007/article/details/78535640
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 860M, pci bus id: 0000:01:00.0)
E tensorflow/stream_executor/cuda/cuda_dnn.cc:397] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
E tensorflow/stream_executor/cuda/cuda_dnn.cc:364] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
F tensorflow/core/kernels/conv_ops.cc:605] Check failed: stream->parent()->GetConvolveAlgorithms(&algorithms) 
已放弃 (核心已转储)

找到如下为tf分配GPU资源代码:

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.6) #gpu资源的占比,显存×0.6
with tf.Session(config=tf.ConfigProto(log_device_placement=False,gpu_options=gpu_options)) as sess:

也可以设置

config.gpu_options.allow_growth = True #开始不会给tensorflow全部gpu资源 而是按需增加

不够不干活,就是这么牛逼。。。。。。。。。。。。

展开阅读全文

没有更多推荐了,返回首页