Dot Indexing is not supported for variables of this type
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 10 Jan 2024
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.
Réponses (1)
Binaya
le 11 Jan 2024
Modifié(e) : Binaya
le 17 Jan 2024
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,
- You can open the "data" and "Yolov2_lgraph" objects in the workspace.
- For "data" object: open value in "gTruth", followed by "ROILabelData", followed by "imageSequence_EnchancedData".
- Check if "imageSequence_EnchancedData" has any structure or class stored as its value.
- 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
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!