I'm training a model for multi-class image classification on AWS sagemaker using a custom dataset. The dataset has around 50 classes. I'm following this notebook: Image classification transfer learning demo
According to my understanding, the final layer of the model outputs probabilities corresponding to each class in our dataset. Sagemaker expects the dataset to be provided in mxnet recordio's .rec format. Since I'm not manually converting the labels to one-hot-encoded, I don't know which layer is ouputing probabilities for which class. How can I get an ordered list of classes where indexes corresponds to the output of final layer of the model.
Even the notebook provided by AWS (Link above) has that ordered list (list: object_categories) hard-coded.
My dataset before converting to .rec format looks like this:
./train/object1/
-image1.jpg
-image2.jpg
-image3.jpg
-...image500.jpg
./train/object2/
-image1.jpg
-image2.jpg
-image3.jpg
-...image500.jpg
.
.
.
./train/object50/
-image1.jpg
-image2.jpg
-image3.jpg
-...image500.jpg
Any help will be highly appreciated.