CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Unable to run MNIST Example 02_Convolution.config

Open fwaris opened this issue 10 years ago • 4 comments

I get an out of memory error (on 2GB NVidia GeoForce mobile card). Can it be configured to reduce less memory (assuming it is truly a memory error. Here is the part of the log file where the error shows up.

Post-processing network complete. evalNodeNames are not specified, using all the default evalnodes and training criterion nodes. starting epoch 0 at record count 0, and file position 0 already there from last epoch RandomOrdering: 1989 retries for 10000 elements (19.9%) to ensure window condition RandomOrdering: recached sequence for seed 0: 2334, 3830, ...

[CALL STACK] >Microsoft::MSR::CNTK::operator<< -Microsoft::MSR::CNTK::GPUSparseMatrix::performInplaceFunction -Microsoft::MSR::CNTK::GPUMatrix::Resize -Microsoft::MSR::CNTK::Matrix::Resize -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -Microsoft::MSR::CNTK::MatrixBase::operator= -BaseThreadInitThunk -RtlUserThreadStart

CUDA failure 2: out of memory ; GPU=0 ; hostname=FAI-HP2 ; expr=cudaMalloc((void**)&m_pArray,sizeof(ElemType)m_elemSizeAllocated) EXCEPTION occurred: CUDA failure 2: out of memory ; GPU=0 ; hostname=FAI-HP2 ; expr=cudaMalloc((void*)&m_pArray,sizeof(ElemType)*m_elemSizeAllocated)

fwaris avatar Feb 04 '16 21:02 fwaris

CNN does consume a lot of memory. you can try adding

shareNodeValueMatrices=true

to the top of the config file to reduce memory usage. If that's not enough you will need to reduce the minibatchSize in the config.

dongyu888 avatar Feb 04 '16 22:02 dongyu888

Hello, Are you using cuDNN-enabled build? I was able to train 02_Convolution sample of my GTX 765M (2GB) just fine. In addition to what Dong said, try setting maxTempMemSizeInSamples to 1 in your config files, that should help in case you are not using cuDNN.

Alexey-Kamenev avatar Feb 05 '16 01:02 Alexey-Kamenev

Unfortunately changing the to suggested values (and even setting mb size to 1) I still see out of memory error. I will look into using the cuDNN version.

fwaris avatar Feb 05 '16 19:02 fwaris

Please reopen this issue if it still persists after trying cuDNN.

mradmila avatar Mar 14 '16 23:03 mradmila