필터 지우기
필터 지우기

Image to be categorized specifically

조회 수: 5 (최근 30일)
Tathva
Tathva 2023년 5월 7일
편집: Tathva 2023년 7월 16일
Thank you. help has been appreciated

답변 (1개)

Rohit
Rohit 2023년 5월 18일
편집: Rohit 2023년 5월 18일
Hi Tathva,
I understand that you want to train a neural network for your dataset but are facing an error related to ImageDataStore having no labels.
The reason for error is that you are passing (numTrainFiles = 2) and that results in "imdsTrain" having all images and "imdsValidation" being empty.
As per the documentation,splitEachLabel(imds,p) splits the image files in imds into two new datastores, "imds1" and "imds2". The new datastore "imds1" contains the first p files from each label and "imds2" contains the remaining files from each label.
So all files are assigned to "imdsTrain" and there are no labels in "imdsValidation".
For your dataset you can set the parameter "numTrainFiles" to 1 if you want to split in train and validation. Otherwise, you can try to increase the number of observations in your dataset.
You can refer to the documentation link for "splitEachLabel" for further reference: https://in.mathworks.com/help/matlab/ref/matlab.io.datastore.imagedatastore.spliteachlabel.html

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by