InnovArul:

I am not sure what the initial target shape [16, 6, 224, 224] means. Is it [batch size, num classes (one hot), H, W]?


Just to answer your question, the second dimension [6] represents each class. Meaning if I iterate through this dim and plot the image I’ll get 6 different images, each has the corresponding class for the input image.
I know what one hot means, but I’m not sure if in this case, it considered a one-hot encoding. At least I don’t think so.
Sorry if this doesn’t make sense.
And to give you some contact, I used this code 2 as a base, but there, we have only 1 class while mine is 6.
By the way I performed it selecting one class and it worked fine.
Thanks a lot