Hello Everyone,
I have a question regarding the use case that I am working on. So, my task is to train AlexNet in self-supervised manner first, by passing the rotated images of the CIFAR10 dataset, and train the model to predict the rotation
After that, I need to extract the features of the first two conv layer of the self-supervised model and use the features to train another model in supervised way on CIFAR10 dataset by just adding a fully connected layer on top of the first two conv layers extracted from self-supervised model. So, currently, I am saving the model parameters and loading the parameters to the Alexnet class. Then, passing the model as a parameter to another class(Alexnet_supervised). I am not sure if this is the correct approach for the same.
Model1 = Alexnet()
checkpoint = torch.load(‘best_model.pt’)
Model1.load_state_dict(checkpoint[‘model_state_dict’])
Model2 = Alexnet_supervised(Model1)
Could anyone help me with this?.
Thanks in advance.