Getting error when using semanticseg function

8 views (last 30 days)
I am trying to use the semanticseg function to segment an image of dimensions 256x232x192 with a trained DAGnetwork. However I keep getting an error saying this:
"Error using gpuArray/cat. Maximum variable size allowed on the device is exceeded.
Error in nnet.internal.cnn.layer.Concatenation/predict (line 54)
Z = cat(this.ConcatenationAxis, X{:});
Error in nnet.internal.cnn.DAGNetwork/activations (line 571)
outputActivations = thisLayer.predict(XForThisLayer);
Error in DAGNetwork/calculateActivations (line 86)
YBatch = predictNetwork.activations({X}, layerIndex, layerOutputIndex);
Error in DAGNetwork/activations (line 138)
Y = this.calculateActivations(X, layerIndex, layerOutputIndex, varargin{:});
Error in semanticseg>iClassifyImagePixels (line 447)
allScores = activations(net, X, name, ...
Error in semanticseg (line 248)
[Lroi, scores, allScores] = iClassifyImagePixels(Iroi, net, params);"
My gpu has 24 GB of RAM, so it seems extremely unlikely that I am running out of memory running this, considering that the image gpuarray I am inputting is much less than 24 GB. I am able to input patches of [64 64 64] and [128 128 128] of the image succesfully and segment it, but I need to be able to input the whole image into the function as well. Is there a bug within the semanticseg function? How can I input the whole image into the semanticseg function? Thank you in advance!
  2 Comments
Walter Roberson
Walter Roberson on 28 Jul 2020
It is not uncommon to start running out of memory when you have an array about 1/3 of the maximum memory of the GPU, and becomes quite likely when you have an array that exceeds half of the maximum memory of the GPU.
Manusree Bhatter
Manusree Bhatter on 28 Jul 2020
The array is less than 1 megabyte, it is nowhere near the maximum memory of the GPU. Could there be an issue with the semanticseg function itself?

Sign in to comment.

Answers (1)

Harsha Priya Daggubati
Harsha Priya Daggubati on 31 Jul 2020

Categories

Find more on Image Data Workflows 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!