How can I save the model as pt file with specific classes?

I am currently studying deep metric learning. I use Cars-196 dataset and save the model in each iteration or epoch to check how data and proxies are updated. But there are quite many classes so I think that it’d be better to reduce classes, save and visualize them.

What is better way to modify for saving specific classes?

  1. reduce the model before training: it means, for example, train only 10 classes
  2. save the model after training but only save 10 specific classes: train all the 98 classes and just save 10 specific classes
  3. save all the data but visualize only 10 specific classes.

It’s generally a good idea to start with fewer classes as you build up intuition on the problem, your iteration cycle will be faster

Typically datasets like Cars will have the labels be part of the folder structure or name of the file or some extra metadata so filter out all but 10 classes. Train a model for those 10 classes and see if you can get your model to overfit. Then increase the number of classes and build a better model :slight_smile:

Yes your Right. I thought it overcomplicating. I just set 10 classes train and set others as test. Thank you so much!