Error when creating pixelLabelDatastore: The value of 'gTruth' is invalid
조회 수: 3 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2019년 9월 16일
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.
채택된 답변
추가 답변 (1개)
hla hla myint
2020년 9월 8일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!