Clear Filters
Clear Filters

Semantic Segmentation Using Deep Learning example error

2 views (last 30 days)
There is a problem executing the following code.
There's no problem here
pretrainedURL = 'https://ssd.mathworks.com/supportfiles/vision/data/deeplabv3plusResnet18CamVid.zip';
pretrainedFolder = fullfile(tempdir,'pretrainedNetwork');
pretrainedNetworkZip = fullfile(pretrainedFolder,'deeplabv3plusResnet18CamVid.zip');
if ~exist(pretrainedNetworkZip,'file')
mkdir(pretrainedFolder);
disp('Downloading pretrained network (58 MB)...');
websave(pretrainedNetworkZip,pretrainedURL);
end
unzip(pretrainedNetworkZip, pretrainedFolder)
That's where the problem comes from
pretrainedNetwork = fullfile(pretrainedFolder,'deeplabv3plusResnet18CamVid.mat');
data = load(pretrainedNetwork); % !! The variable 'metrics' stored in semantic Segmentation Metrics cannot be instantiated as an object and is read as unit32
There's an error here too
net = data.net; % The variable 'net' originally stored in the DAG Network cannot be instantiated as an object and is read as unit32.
.....
classes = string(net.Layers(end).Classes) % This type of variable does not support point indexing.
What's wrong with you?
How can we solve it..

Accepted Answer

檮杌
檮杌 on 3 Oct 2023
Hi,
Your issue is not reproducible in my end.
Are you sure that you have successfully installed Deep Learning Toolbox? Your MATLAB does not recognize "semanticSegmantationMetrics" or "DAGNetwork" as objects but treats them as "uint32". As indicated in the doc, the example requires not only Computer Vision Toolbox but also Deep Learning Toolbox to begin with. Please check the output of "ver" and see if Deep Learning Toolbox is correctly installed.

More Answers (0)

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!