MATLAB Answers

Invalid training data. Responses must be nonempty when using networkTrain on CNN

56 views (last 30 days)
Carlos Ramirez
Carlos Ramirez on 3 Sep 2020
Commented: drummer on 23 Oct 2020 at 13:53
Hello,
I'm having issues with the transform of an ImageDatastore when is used as input to the networkTrain method. If I use the original ImageDatastore as input to the networkTrain, everything works as a charm. By using the read method on the transformed datastore and visualizing the images with imshow() I can see that the transform function is doing what is supposed to do (i.e., adding noise to the images in the ImageDatastore). However, when passing the TransformedDatastore to the networkTrain, the following message is thrown:
Error using trainNetwork (line 170)
Invalid training data. Responses must be nonempty.

  0 Comments

Sign in to comment.

Accepted Answer

Mohammad Sami
Mohammad Sami on 4 Sep 2020
If you have image processing toolbox, you may perhaps use denoisingImageDatastore

  8 Comments

Show 5 older comments
M J
M J on 22 Oct 2020 at 21:50
Hi there, my transforming function actually takes a subset of the entire training image datastore. Can I apply it the same way as you did so that my function creates custom batches during the training process (every time it gets called)? Thanks!
drummer
drummer on 23 Oct 2020 at 13:53
Great, it worked to me too.
Thanks.
I'm performing affine geometric transformation to volumetric images and MATLAB was also returning such error.
But only one thing I would like to ask to @Carlos is why you transformed all the imds?
Wasn't the purpose of your transformation to augment training data? This way, only imdsTrain would be applied the transformation...
I know there are several purposes to transform data. My question is just out of curiosity...
cheers

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!