How can i extract images from locations

2 vues (au cours des 30 derniers jours)
mohebba naaz
mohebba naaz le 10 Août 2020
I have 1000 images for training.
i have used imagedatastore for storing images .
after building network and diving images into testing and training. ie Xtrain,Ytrain.Xtest,Ytest where X is images with corresponding label in Y
I am unable to train.
My Xtrain Folder has locations like
ans =
5×1 cell array
{'E:\prototype\A\1.png' }
{'E:\prototype\A\10.png'}
{'E:\prototype\A\11.png'}
{'E:\prototype\A\12.png'}
{'E:\prototype\A\17.png'}
but for training this has to be image
  2 commentaires
Image Analyst
Image Analyst le 10 Août 2020
So why does it think the PNG files are not image files?
mohebba naaz
mohebba naaz le 11 Août 2020
Error using trainNetwork (line 170)
Invalid training data. Predictors must be a N-by-1 cell array of sequences, where N is the number of
sequences. All sequences must have the same feature dimension and at least one time step.
Error in net1code_naaz (line 105)
net = trainNetwork(XTrain,YTrain,layers,options);
this is the error i have got.
i am unable to train data with image locations

Connectez-vous pour commenter.

Réponse acceptée

Srivardhan Gadila
Srivardhan Gadila le 17 Août 2020
net = trainNetwork(X,Y,layers,options)
Then X should be the numeric array which contains the predictor variables and Y should be the categorical labels or numeric responses. Hence X shouldn't be the cell array which contains image locations (like in the question above).
If you are using the datastore then the following syntax must be used:
net = trainNetwork(imds,layers,options)
where imds is the imageDatastore.
Refer to the documentation of trainNetwork for more information.

Plus de réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by