Why doesn't my CNN fit into the memory of the GPU?
Show older comments
Hi,
I tried to inflate the vgg16 to 3D using this function: https://se.mathworks.com/matlabcentral/fileexchange/87594-3d-convolutional-neural-network?s_tid=srchtitle . It worked fine (at least it didn't list any errors when using analyzeNetwork()), but when I try to train the network as batch job using GPU, it displays:
Error using parallel.Job/fetchOutputs (line 1264)
An error occurred during execution of Task with ID 1.
Caused by:
Error using trainNetwork (line 183)
Maximum variable size allowed on the device is exceeded.
Error using nnet.internal.cnngpu.convolveForwardND
Maximum variable size allowed on the device is exceeded.
However, the GPU used is a tesla v100 with a 32GB of RAM. And if I use the command whos lgraph to read the size of the network, it only gives:
whos lgraph
Name Size Bytes Class Attributes
lgraph 1x1 176553068 nnet.cnn.LayerGraph
But how come it is said that 2D vgg16 is already 500 MB, but my 3D vgg16 sits around at only 180 MB? How do I calculate the actual memory size of the network and what is needed at the GPU? My images (volumes) are of the size:
whos v
Name Size Bytes Class Attributes
v 224x224x224 44957696 single
And my minibatchsize is 10.
Accepted Answer
More Answers (0)
Categories
Find more on Parallel and Cloud in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!