Dot Indexing is not supported for variables of this type
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2024-1-10
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.
回答(1 个)
Binaya
2024-1-11
编辑:Binaya
2024-1-17
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!