How can i extract images from locations

2 visualizaciones (últimos 30 días)
mohebba naaz
mohebba naaz el 10 de Ag. de 2020
Respondida: Srivardhan Gadila el 17 de Ag. de 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 comentarios
Image Analyst
Image Analyst el 10 de Ag. de 2020
So why does it think the PNG files are not image files?
mohebba naaz
mohebba naaz el 11 de Ag. de 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

Iniciar sesión para comentar.

Respuesta aceptada

Srivardhan Gadila
Srivardhan Gadila el 17 de Ag. de 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.

Más respuestas (0)

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by