Hello,
I understand that you are trying to train a U-Net Network with a specific set of images and labels. You encountered an error related to the validation response variable data. This error indicates that the categorical response variable must be a vector or a single-channel, two-dimensional or three-dimensional image.
The error might have occurred due to a mismatch between the data dimensions. Please make sure that your response variable data is in the correct format. It should be a vector or a single-channel 2D or 3D image.
You can follow the below steps to fix the issue.
- Verify the format of your response variable data. It should be a vector or a single-channel 2D or 3D image.
- Check the size and dimensions of your response variable data. It should match the input size and dimensions of your network.
- Validate the label IDs that you are using for training. Make sure they correctly correspond to the labels in your data.
- Validate the data you are using for training. Make sure it meets the requirements of the "trainNetwork" function.
You can refer to the below documentation to understand more about the "trainNetwork" function in MATLAB.