3-D Brain Tumor Segmentation ERROR

Technical Source
2 min readJun 24, 2021

--

Hi all,

I’m getting the following error running the 3-D Brain Tumor Segmentation example

(https://www.mathworks.com/help/images/segment-3d-brain-tumor-using-deep-learning.html)

Error using trainNetwork (line 165)

Incorrect loss type returned by ‘forwardLoss’ in the output layer. Expected to be ‘single’, but instead was ‘gpuArray’.

The output layer is dicePixelClassification3dLayer. It seems like there’s some kind of error in the definition of that custom layer. Converting to single the outputs of the layer methods didn’t help, same error.

If it’s helpful I’m using r2019a on windows 10 on a i9 9900k + 1080ti.

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

Hi,

The issue exposed here is related to low GPU memory. That being said, the following error should not be thrown. I have heard that this issue is known, and the concerned parties may be investigating further.

'Conversion to single from gpuArray is not possible'

A possible Workaround:

The attached patch will fix the error mentioned above, in the sense that the above error message will not be thrown if the training process errors out due to low GPU memory. Follow the steps below to apply the patch.

1) Save the attached zip file to your $MATLABROOT folder. The $MATLABROOT folder can be determined by running the ‘matlabroot’ command.

2) Using MATLAB, navigate to your $MATLABROOT folder by executing the command:

cd(matlabroot) in the MATLAB Command Window.

3) Execute the following command to unzip the file:

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet