Python 当我将theano.config.device设置为gpu时,程序中出现内存错误

Python 当我将theano.config.device设置为gpu时,程序中出现内存错误,python,gpu,theano,Python,Gpu,Theano,我的图形系统是GT550M 当我在gpu上运行我的程序时,它会给出以下错误,我不知道如何解决这个问题 MemoryError: error freeing device pointer 0x0000000500C60000 (the launch timed out and was terminated) Apply node that caused the error: GpuReshape{4}(GpuConv{valid, (2, 2), None, (7, 7), True, (3, 2

我的图形系统是GT550M

当我在gpu上运行我的程序时,它会给出以下错误,我不知道如何解决这个问题

MemoryError: error freeing device pointer 0x0000000500C60000 (the launch timed out and was terminated)
Apply node that caused the error: GpuReshape{4}(GpuConv{valid, (2, 2), None, (7, 7), True, (3, 224, 224), (7, 7)}.0, TensorConstant{[672   1 109 109]})
Inputs types: [CudaNdarrayType(float32, 4D), TensorType(int64, vector)]
Inputs shapes: [(7, 96, 109, 109), (4L,)]
Inputs strides: [(1140576, 11881, 109, 1), (8L,)]
Inputs scalar values: ['not scalar', 'not scalar']

Debugprint of the apply node: 
GpuReshape{4} [@A] <CudaNdarrayType(float32, (False, True, False, False))> ''   
 |GpuConv{valid, (2, 2), None, (7, 7), True, (3, 224, 224), (7, 7)} [@B] <CudaNdarrayType(float32, 4D)> ''   
 | |GpuDimShuffle{0,3,1,2} [@C] <CudaNdarrayType(float32, 4D)> ''   
 | | |GpuFromHost [@D] <CudaNdarrayType(float32, 4D)> ''   
 | |   |x [@E] <TensorType(float32, 4D)>
 | |<CudaNdarrayType(float32, 4D)> [@F] <CudaNdarrayType(float32, 4D)>
 |TensorConstant{[672   1 109 109]} [@G] <TensorType(int64, vector)>

HINT: Re-running with most Theano optimization disabled could give you a back-traces when this node was created. This can be done with by setting the Theano flags optimizer=fast_compile
MemoryError:释放设备指针0x0000000500C6000时出错(启动超时并已终止)
导致错误的应用节点:GpuReshape{4}(GpuConv{valid,(2,2),None,(7,7),True,(3,224,224),(7,7)}.0,TensorConstant{[672 1 109]})
输入类型:[cudandaraytype(float32,4D),TensorType(int64,vector)]
输入形状:[(7,96,109,109),(4L,)]
输入跨步:[(114057611881109,1),(8L,)]
输入标量值:[“非标量”、“非标量”]
应用节点的调试打印:
GpuReshape{4}[@A]''
|GpuConv{valid,(2,2),None,(7,7),True,(3224224),(7,7)}[@B]'
|| GpuDimShuffle{0,3,1,2}[@C]'
|| | GpuFromHost[@D]”
|| | x[@E]
||[@F]
|张量恒量{[6721109]}[@G]
提示:在禁用大多数Theano优化的情况下重新运行可能会返回创建此节点时的跟踪。这可以通过设置Theano flags optimizer=fast\u compile来完成

cuda的错误是异步返回的。因此,部分错误消息可能是无关的。这是第一行:

MemoryError:释放设备指针0x0000000500C6000时出错(启动超时并已终止)

答案在第二部分:发射超时并被终止

您的GPU已连接到显示器。在这种情况下,每个GPU内核调用有5s的限制。碰巧它被破坏了,驱动程序杀死了内核。这是为了防止屏幕没有响应

可能的解决办法: 1) 为显示器使用不同的gpu。 2) 通过使用较小的输入数据(例如,较小的批处理大小)加快内核速度 3) 买一个更快的GPU,不确定它是否能工作,如果它能与你目前的大小,问题将出现在更大的大小