Clear Filters
Clear Filters

Table error when using an augmented and transformed datastore for training a neural network?

2 views (last 30 days)
I have created an augmented datastore with a number of randomized augmentaitons. I would like to add a custom augmentation (randomized histogram scaling) so I created a tranformed datastore. I then combiend these and attempted to use the combined datastore to train a neural network. I get the error below. Please advise. Thanks!
Error using trainNetwork (line 184)
All input arguments must be tables.
Error in TrainNetworks (line 8)
net2 = trainNetwork(imds2,layers{1},options{1});
Caused by:
Error using (line 144)
All input arguments must be tables.
imageAugmenter = imageDataAugmenter( ...
'RandRotation',[-15,15], ... %+/- 15 degrees rotation
'RandScale',[.95 1.05], ... %randomlys cale image up or down 5 percent
'RandXShear',[0 5], ... %randomly apply up to 5% shear
'RandYShear',[0 5], ... %randomly apply up to 5% shear
'RandXTranslation',[-80 80], ... %randomly translate 30 pixels
'RandYTranslation',[-60 60]); %randomly translate 30 pixels
dsnew=transform(imds,@(x) transformhist(x));
net = trainNetwork(imds2,layers{1},options{1});

Answers (1)

Dheeraj on 5 Sep 2023
I understand you’re trying to combine two data stores to have a single combinedDataStore to pass as the argument to the “trainNetwork” function and the first argument in “trainNetworkcan be of a numeric array, table or a datastore data types. The second argument can be of type Layer Array or LayerGraph object. So, the problem might be with how you’re passing the data to the trainNetwork. You could share your complete code in case this does not solve your query.
You could refer to this MATLAB documentation to have a better understanding about trainNetwork.




Community Treasure Hunt

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

Start Hunting!