tensorflow: tensorflow crashes when using large image with 3d convolutional network
I’m trying to implement a 3d fully convolutional network on my GPU. But for some reason I get a crash.
Environment info
Operating System: Ubuntu 14.04 LTS GPU: GeForce Titan X .
Installed version of CUDA and cuDNN: 8.0 and 5 (attach the output of `ls -l /path/to/cuda/lib/libcud* cud.filelist.txt )
I installed tensorflow version 0.11.0rc2, and it also reproduce in docker installation (gcr.io/tensorflow/tensorflow:latest-gpu)
Example code
The following code reproduce the problem:
import numpy as np
import tensorflow as tf
graph = tf.Graph()
with graph.as_default():
tf_dataset = tf.placeholder(tf.float32, shape=(1, 512, 512, 512, 1))
tf_label = tf.placeholder(tf.float32, shape=(1, 512, 512, 512, 1))
layer1_weights = tf.Variable(tf.truncated_normal((2, 2, 2, 1, 1), stddev=0.1))
layer1_bias = tf.Variable(tf.zeros(1))
conv = tf.nn.conv3d(tf_dataset, layer1_weights, (1, 1, 1, 1, 1), padding='SAME')
logits = tf.nn.relu(conv+layer1_bias)
loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits, tf_label))
optimizer = tf.train.GradientDescentOptimizer(0.05).minimize(loss)
with tf.Session(graph=graph) as session:
tf.initialize_all_variables().run()
batchData = np.random.rand(1, 512, 512, 512, 1).astype(np.float32)
batchLabels = (np.random.rand(1, 512, 512, 512, 1)>0.5).astype(np.float32)
feed_dict = {tf_dataset : batchData, tf_label : batchLabels}
_ = session.run((optimizer, ), feed_dict=feed_dict)
with the following output:
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties: name: GeForce GTX TITAN X major: 5 minor: 2 memoryClockRate (GHz) 1.076 pciBusID 0000:01:00.0 Total memory: 11.92GiB Free memory: 11.68GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:01:00.0) F tensorflow/stream_executor/cuda/cuda_dnn.cc:2440] failed to enqueue convolution on stream: CUDNN_STATUS_NOT_SUPPORTED
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 48 (8 by maintainers)
Can confirm this issue as well. I’m having exactly the same problem! Would be great if this could be resolved 😃
@prb12, @zheng-xq any updates on this issue?
can confirm a similar issue with large 3D convolutions:
will yield
tensorflow/stream_executor/cuda/cuda_dnn.cc:2674] failed to enqueue convolution on stream: CUDNN_STATUS_EXECUTION_FAILED. It runs fine if I setinshape = (2,257,257,34,1)instead, so there’s some issue with the sizes. However I dont think its the usual GPU-out-of-memory issue:(2,300,300,34,1)without trouble)Turns out that it’s somehow related to the gradient computations, i.e. commenting the
gradQ =...line, just evaluating the result of the convolutions works!Code was run on tensorflow 0.11.0rc2 (same happens for 0.12.1), Titan X, CUDA-8.0, cudnn 5
Similar problem here with deep 2d convolution network and huge batch size (because my input is [seq_length * batch_size, height, width] ).
Change batch size to a smaller one solves the issue. It’d great if it can throw a python exception : )
@deepak09027 Unfortunately I dont have any solution yet. I was hoping that some googler picks it up here 😃
@HggsHntr I’m just a simple computer scientist. Your questions are reasonable, but it’s hard for me to think beyond testing whether a smaller image works or not.
I am having the same issue as well