I was right. i solved the problem by changing:
- The size of the inputs [1 X 3] to [Y Z 3], where Y*Z=X
- The size of the labels [1 X 1] to [Y Z 1], where Y*Z=X
- Add a custom layer after the input layer to convert the input to [1 X 3] so that it could be used in the network.
- Add a custom layer before softmax layer to convert the output [1 X numClass] back to [Y Z numClasses] so that it could be compared to the response labels
Therefore, I would say the problem is either one or all of these functions [imageDatastore, pixelLabelDatastore, pixelLabelImageDatastore] where it doesn't know how to handle single row or column images (note: I also tried having inputs and labels of the size [X 1 3] and [X 1 1] respectively but received the same error shown in the question).