Dot Indexing is not supported for variables of this type

I'm getting an error from the below code. It is showing me "Dot indexing is not supported for variables of this type"
data = load('Labels.mat');
S = dir(fullfile('C:\Users\surya\OneDrive\Desktop\Project Work\Target detection and recognition in underwater turbid areas using machine learning\Code\Enchanced Data\*.jpg'));
Extract_name = extractfield(S,'name');
Extract_name = Extract_name';
Extract_folder = extractfield(S,'folder');
Extract_folder = Extract_folder';
merge_cell = fullfile(Extract_folder,Extract_name);
merge_cell_table = cell2table(merge_cell);
data_goods = data.gTruth.ROILabelData.imageSequence_EnchancedData.gTruth;
data_goods = cell2table(data_goods);
trainingData = [merge_cell_table,data_goods];
shuffledIdx = randperm(height(trainingData));
trainingData = trainingData(shuffledIdx,:);
imds = imageDatastore(trainingData.merge_cell);
blds = boxLabelDatastore(trainingData(:,2:end));
ds = combine(imds, blds);
load('Yolov2_lgraph.mat');
lgraph = Yolov2_lgraph.lgraph;
% analyzeNetwork(lgraph);
lgraph.Layers;
options = trainingOptions('sgdm',...
'InitialLearnRate',0.001,...
'Verbose',true,...
'MiniBatchSize',16,...
'MaxEpochs',100,...
'Shuffle','never',...
'VerboseFrequency',30,...
'CheckpointPath',tempdir);
The Error I'm getting is:
Dot indexing is not supported for variables of this type.
data_goods = data.gTruth.ROILabelData.imageSequence_EnchancedData.gTruth;

댓글 수: 3

Hi Surya,
Is it possible to attach the "Labels.mat" with the question ?
Thanks
In order to test we would need Labels.mat, Yolov2_lgraph.mat, and C:\Users\surya\OneDrive\Desktop\Project Work\Target detection and recognition in underwater turbid areas using machine learning\Code\Enchanced Data\*.jpg
We need to test because you did not post a full error message showing which line is generating the error.
The Error I'm getting is...Dot indexing is not supported for variables of this type.
It should be easy for you to trap it with dbstop and see which variable is not the expected type.

댓글을 달려면 로그인하십시오.

답변 (1개)

Binaya
Binaya 2024년 1월 11일
편집: Binaya 2024년 1월 17일

2 개 추천

Hi SuryaTeja
Based on the description of the error, I understand that you are getting the error:"dot indexing is not supported for variables of this type". This error is found when you are trying to access the fields of an object which does not have any methods or properties.
To find the source of this error and to resolve this,
  1. You can open the "data" and "Yolov2_lgraph" objects in the workspace.
  2. For "data" object: open value in "gTruth", followed by "ROILabelData", followed by "imageSequence_EnchancedData".
  3. Check if "imageSequence_EnchancedData" has any structure or class stored as its value.
  4. If the value stored here is not a structure or class, MATLAB shows the error that this variable does not support dot indexing.
I hope this helps
Regards
Binaya

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2024년 1월 10일

편집:

2024년 1월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by