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

cnnnetworktrain

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.

Best Answer

If you have image processing toolbox, you may perhaps use denoisingImageDatastore
Related Question