Hey! I am loading the same network (before even training, right after the initialization) from a pickle file, but it has different parameters every time.
I tried 2 different ways of saving and loading:
net = …
with open(‘train.pickle’, ‘wb’) as f:
pickle.dump([net], f)
then:
with open(‘train.pickle’, ‘rb’) as f:
net1 = pickle.load(f)
with open(‘train.pickle’, ‘rb’) as f:
net2 = pickle.load(f)
net1=net1[0]
net2=net2[0]
print(net1.eval()==net2.eval()) //gives False
if net1.parameters() != net2.parameters():
print(True) //gives True.
I also tried:
torch.save(model, PATH)
model = torch.load(PATH)
How can I fix this?