Hi
I loaded a a saved model in two ways. But when I feed an image, the results of softmax layer are not the same. I don’t know what’s the reason. My piece of codes are as follow.
my first method is:
  class myModel(nn.Module):
def __init__(self):
    super(myModel,self).__init__()
    self.vgg_model = torch.load('bestmodel.pt')
    self.vgg_model.eval()
    self.convs=[]
    for child in self.vgg_model.children():
        self.convs.append(child)        

def forward(self,x):
    for i in range(9):
        x = self.convs[i](x)
    x = x.view(-1, 1 * 1 * 512)
    x = self.convs[9](x)
    print(x)
    return x

the second method is:
mymodel = torch.loard('bestmodel.pt')

I used the transfer learning on resnet for ants and bees dataset. The class prediction of the network for input images are similar, but the returned real values in softmax are not the same. As a matter of fact, I am worry about bad effects of this event  in my future works.
Please guide me what is the reason for this difference?
does the first method uses weights of the saved model? or does it only use the definition of different kind of layers and randomly initialize the weights?
Thank you in advance