내 데이터 집합의 회색조 이미지 크기가 200x200
인 분류 문제에 Deep Learning을 적용하고 싶습니다. 현재, 거대한 데이터 세트 (15,000 개 이상의 이미지) 중 아주 작은 하위 세트 (152 개 이미지)에서 DL을 테스트하고 있습니다. Python (Python 2.7.12 :: Anaconda 4.2.0 (64-bit))에서 Theano (버전 '0.9.0.dev4') 백엔드와 Keras (버전 '1.1.2') 라이브러리를 사용하고 있습니다. 내 코드는 CPU에서 실행되지만 매우 느립니다. 그래서 GPU로 전환했습니다. 그러나, 나는 오류가 아래에 무엇입니까 :GPU에서 Keras를 사용하여 메모리가 부족합니다.
Using Theano backend.
Using gpu device 0: GeForce GTS 450 (CNMeM is enabled with initial size: 70.0% of memory, cuDNN not available)
Train on 121 samples, validate on 31 samples
Epoch 1/200
Traceback (most recent call last):
File "<ipython-input-6-247bada3ec1a>", line 2, in <module>
verbose=1, validation_data=(X_test, Y_test))
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/keras/models.py", line 652, in fit
sample_weight=sample_weight)
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/keras/engine/training.py", line 1111, in fit
initial_epoch=initial_epoch)
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/keras/engine/training.py", line 826, in _fit_loop
outs = f(ins_batch)
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 811, in __call__
return self.function(*inputs)
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/theano/compile/function_module.py", line 886, in __call__
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/user1/anaconda2/envs/keras_env/lib/python2.7/site-packages/theano/compile/function_module.py", line 873, in __call__
self.fn() if output_subset is None else\
MemoryError: Error allocating 160579584 bytes of device memory (CNMEM_STATUS_OUT_OF_MEMORY).
Apply node that caused the error: GpuElemwise{Composite{(i0 * (i1 + Abs(i1)))},no_inplace}(CudaNdarrayConstant{[[[[ 0.5]]]]}, GpuElemwise{Add}[(0, 0)].0)
Toposort index: 60
Inputs types: [CudaNdarrayType(float32, (True, True, True, True)), CudaNdarrayType(float32, 4D)]
Inputs shapes: [(1, 1, 1, 1), (32, 32, 198, 198)]
Inputs strides: [(0, 0, 0, 0), (1254528, 39204, 198, 1)]
Inputs values: [CudaNdarray([[[[ 0.5]]]]), 'not shown']
Outputs clients: [[GpuContiguous(GpuElemwise{Composite{(i0 * (i1 + Abs(i1)))},no_inplace}.0)]]
HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'.
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
내가 제안 된 솔루션 (optimizer=fast_compile
및 optimizer=None
)을 시도했지만 그것은 작동하지 않았다. 문제가 이미지 크기와 관련되어 있다는 것을 알고 있습니다. 이미지 크기를 50x50
으로 변경했을 때 효과가 있었기 때문입니다.
200x200
이미지에 적용 할 수 있도록 문제를 해결할 수있는 방법을 알고 계십니까? cuDNN를 사용하여 내 문제에 대한 올바른 해결책 인 경우
02:00.0 VGA compatible controller: NVIDIA Corporation GF106 [GeForce GTS 450] (rev a1)
[ 64.299] (--) NVIDIA(0): Memory: 1048576 kBytes
[ 64.313] (II) NVIDIA: Using 12288.00 MB of virtual memory for indirect memory
[ 64.439] (==) NVIDIA(0): Disabling shared memory pixmaps
나는 잘 모르겠지만, 난 이미 .theanorc
에 optimizer_including=cudnn
을 포함하여 그것을 사용하여 시도했다 : 나는 리눅스 마제 야 5 내 GPU 정보를 사용하고
입니다 ; 하지만 오류가 아래에 무엇입니까 :
AssertionError: cuDNN optimization was enabled, but Theano was not able to use it. We got this error:
Device not supported
나는 나의 GPU 컴퓨팅의 호환성합니다 (cudnn GPU의 CC 요구 사항 (3.0 이상)보다 작은) 2.1이기 때문에이있을 것 같아요.
문제를 해결하고 대규모 데이터 세트에서 DL을 실행하는 데 도움을 주시면 감사하겠습니다.
코드를 보지 않고 말하기는 어렵지만 GPU에 작은 배치로 이미지를로드 할 수 있습니까? – Atirag
cuDNN은 GFS450 Fermi (GF106) GPU에서 작동하지 않습니다. cuDNN에는 케플러 GPU가 필요합니다. 그것은 당신이 당신의 GPU에 기억이 부족한 것 같아요, 그리고 GTS450은 많은 메모리 (1GB)없이 꽤 오래된, 낮은 엔드 GPU입니다. –
@Atirag 작은 배치 크기를 시도했지만 비슷한 오류가 발생합니다. – SaraG