How to pass a set of class labels by force to a model? Context: Multicategory image classification

Hi,

I would really appreciate if someone could tell me a method where I can forcibly pass a set of labels during the data creation factory methods. I am training a model with 38 independent labels for multilabel classification, and I am never getting all 38 because my toy dataset is very small and some of the labels are being deleted because they do not appear in the train set.

Apart from manually creating two lists or using a flag in my dataframe to partition data between train and validation, is there some way I can pass the databunch object some sort of list of labels?

Regards,
Aashish

I figured it out. However, the entire process was tedious because the key-word argument was passed up the chain as a part of **kwargs.

posting solution for someone else who may need it.

.label_from_df(label_delim = ',', classes = list(label_set_))

1 Like

Thank you for sharing article and information. this is very helpful for me.

1 Like

just make sure you maintain the order of the labels every time you load the model. Maybe store the labels in a text file or something.

Thank you for sharing article and information. this is very helpful for me .