How can i extract images from locations

2 ビュー (過去 30 日間)
mohebba naaz
mohebba naaz 2020 年 8 月 10 日
回答済み: Srivardhan Gadila 2020 年 8 月 17 日
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 件のコメント
Image Analyst
Image Analyst 2020 年 8 月 10 日
So why does it think the PNG files are not image files?
mohebba naaz
mohebba naaz 2020 年 8 月 11 日
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

サインインしてコメントする。

採用された回答

Srivardhan Gadila
Srivardhan Gadila 2020 年 8 月 17 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by