Who can help to solve the problem? What is the data type of the "dataIn" in the function dataout = GFR2filter_crop(dataIn, kerfcn, s1, s2, inputSize) since it inputs the batch size of images for training?
errors in using transform for imagedatastore in deep learning
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A part of source code:
dsnew_trn = transform(ds_trn, @(x) GFR2filter_crop(x, kerfcn, s1, s2, inputSize));
dsnew_tst = transform(ds_tst, @(x) GFR2filter_crop(x, kerfcn, s1, s2, inputSize));
trainedNet = trainNetwork(dsnew_trn,lgraph,opts);
ds_trm: original imagedatastore for training; read images by using a custom function, output: double type
ds_tst: original imagedatasotre for testing; the same to the above.
batch size: 64
function dataout = GFR2filter_crop(dataIn, kerfcn, s1, s2, inputSize)
NoImg = size(dataIn);
dataout = cell(NoImg,1);
for xxx=1:NoImg
Img = dataIn{xxx};
%}
I_spatial = Img(:,:,1);
R1 = imfilter(I_spatial, kerfcn);
trasImg(:,:,1)=R1(s1:s1+inputSize(1)-1,s2:s2+inputSize(2)-1);
I_spatial = Img(:,:,2);
R2 = imfilter(I_spatial, kerfcn);
trasImg(:,:,2)=R2(s1:s1+inputSize(1)-1,s2:s2+inputSize(2)-1);
I_spatial = Img(:,:,3);
R3 = imfilter(I_spatial, kerfcn);
trasImg(:,:,3)=R3(s1:s1+inputSize(1)-1,s2:s2+inputSize(2)-1);
dataout{xxx}=trasImg;
end
-----------------------------------
Error message:
Error using trainNetwork (line 170)
Invalid transform function defined on datastore.
Error in alaska2_deeplearningxx (line 74)
trainedNet = trainNetwork(dsnew_trn,lgraph,opts);
Caused by:
Error using nnet.internal.cnn.util.NetworkDataValidator/assertDatastoreHasResponses (line 140)
Invalid transform function defined on datastore.
Error using cell
Size inputs must be scalar.
3 commentaires
Bhargavi Maganuru
le 9 Juil 2020
Makesure the input to the transform is a datastore . Could you mention the version of MATLAB you are using?
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!