我尝试使用VGG16进行一些基本的迁移学习代码。我使用的是Ubuntu 16.04、TensorFlow 1.3和Keras,并且我有4个1080ti GPU。
当我运行到这行代码时:
datagen = ImageDataGenerator(rescale=1. / 255)
model = applications.VGG16(include_top=False, weights='imagenet')
nvidia-smi的输出如下所示:
Processes: GPU Memory |
| GPU PID Type Process name Usage
| 0 14241 G /usr/lib/xorg/Xorg 256MiB |
| 0 14884 G compiz 155MiB |
| 0 16497 C /home/simon/anaconda3/bin/python 10267MiB |
| 1 16497 C /home/simon/anaconda3/bin/python 10611MiB |
| 2 16497 C /home/simon/anaconda3/bin/python 10611MiB |
| 3 16497 C /home/simon/anaconda3/bin/python 10611MiB |
+-----------------------------------------------------------------------------+
接下来在终端的输出为
2017-09-02 15:59:15.946927: E tensorflow/stream_executor/cuda/cuda_dnn.cc:371] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
2017-09-02 15:59:15.946960: E tensorflow/stream_executor/cuda/cuda_dnn.cc:338] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
2017-09-02 15:59:15.946973: F tensorflow/core/kernels/conv_ops.cc:672] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms)
我的jupyter笔记本内核死了。
显然这是一个内存问题,但我不明白为什么突然间我的GPU被这段代码占用。需要补充一下的是,这个问题只出现在过去24小时内,而且所有这些代码都在一天前运行得很好。这里有很多类似问题的答案,但它们都涉及到其他TF实例(并建议关闭它们)。在我的情况下,这是唯一运行的TF应用程序(或任何其他应用程序)。