3-D Brain Tumor Segmentation ERROR
이전 댓글 표시
Hi all,
I'm getting the following error running the 3-D Brain Tumor Segmentation example
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.
Any Help?
Thanks
댓글 수: 6
Joss Knight
2019년 8월 24일
You were also getting the "GPU low on memory" warning, yes? This is an artifact of custom layers and low memory, and is best fixed by reducing memory load (reduce minibatch size or patches per image).
Roberto
2019년 8월 24일
Joss Knight
2019년 8월 25일
My experience with the brain segmentation example was that it is a good demonstration of how to get started with U-Net, but it does need some tuning, of hyper parameters and data augmentation. Also remember that after reducing the mini-batch size the network doesn't have much to go on when determining the accuracy of each iteration, especially given that this is a binary classification. Out of a handful of sample patches sometimes (often?) they'll all be classified correctly even when the network hasn't successfully converged. You're better off focussing on the validation accuracy (which itself needs some tuning) and the loss. I think the high-looking loss is an artifact of the custom DICE classification layer.
This issue with the error is fixed in a future version.
Joss Knight
2019년 8월 25일
편집: Joss Knight
2019년 8월 25일
By the way, I believe you can also fix this by converting the output of the forwardLoss method of the dicePixelClassificationLayer from gpuArray back to ordinary arrays using gather. Something like
loss = gather(loss);
should do the trick.
Joss Knight
2019년 8월 26일
The type problem and the low memory warning go together. If you're getting the low memory warning, you have a real problem that needs addressing, otherwise training performance will be seriously affected. The fix for the type error will allow training to continue, but you'll still need to deal with the low memory issue.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
