Hello,
I have make two training on image classification.
First training on type of glass
Second on type of clothes
So I have two files: glass.pth and clothes.pth
I would like now merge this two files on one.
Do you know how it is possible to do this ?
You could use this approach, but would need to check, if just averaging different parameters is the right approach.
E.g. if both models converged to a completely different set of parameters, I would assume that the average of these models could perform badly.
You could use a mapping between the class indices and the label names, e.g. via a dict, where the keys could be the class indices and the values the class names.
You can assign any attribute to the model, but note that only parameters and buffers would show up in the state_dict. If you want to store it, you could add the mapping to the checkpoint manually and save it in a similar way as e.g. the epoch argument is stored in the ImageNet example.