Error when creating pixelLabelDatastore: The value of 'gTruth' is invalid
4 views (last 30 days)
Show older comments
Heather Riley
on 16 Sep 2019
Answered: hla hla myint
on 8 Sep 2020
I am trying to create a pixelLabelDatastore to hold some segmented images that I created using Matlab's ImageLabeller.
The line:
labels = pixelLabelDatastore(data.gTruth);
in my code results in the following error:
Error using pixelLabelDatastore>parseGroundTruthInputs (line 225)
The value of 'gTruth' is invalid. Undefined function 'hasTimeStamps' for input
arguments of type 'cell'.
Error in pixelLabelDatastore (line 203)
[gTruth, params] = parseGroundTruthInputs(varargin{:});
Error in segmentation_neural_network (line 22)
labels = pixelLabelDatastore(data.gTruth);
data is a matfile containing the gTruth object generated by ImageLabeller:
data = matfile(strcat(training_datapath,'/pixel_maps/eye_segmentation_labels.mat'));
Below is my full script.
% Set datapath
datapath = '/scratch/qbi/uqhrile1';
training_datapath = strcat(datapath,'/training_dataset');
% Get training dataset
training_dataset = imageDatastore(strcat(training_datapath,'/images_rgb'));
% Get pixel map labels
data = matfile(strcat(training_datapath,'/pixel_maps/eye_segmentation_labels.mat'));
labels = pixelLabelDatastore(data.gTruth);
This script worked fine in the directory where I first created it (on an external harddrive). When I moved it and the dataset onto a supercomputer using an SSH connection the code stopped working.
Update: I just realized that different operating systems may be the cause of the issue. When I run my code on Windows it works fine, but the supercomputer I've moved it to is Linux. Could moving my mat file from Windows to Linux have changed the way its data is recognised? When I run
class(data.gTruth)
on Windows the variable is recognised as a ground truth object, but when I run my code on the supercomputer it seems to be treated as a cell array. I'm just waiting for supercomputer resources to become available and then I'll run the class function on there and update my question with the result.
2 Comments
Walter Roberson
on 16 Sep 2019
When I use imageLabeller(), I do not seem to get any Ground Truth objects generated ?
MATLAB thinks that your data.gTruth is a cell array.
Accepted Answer
More Answers (1)
hla hla myint
on 8 Sep 2020
How to create ground turth object in 3 D volumetric with file extension nii. I know 2 D image, ground turth object create labeler app.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!