You definitely need to save your model…otherwise you get a model with random weights later on…
ok thank
so am i correct i need to put that code at the end of a code.
torch.save(net.state_dict(), 'my_model.pth')
and when i want to use it for test i need to use this code
model.load_state_dict(torch.load('my_model.pth'))
and test my model am i correct
is to load is thiswhile thing
model = TheModelClass(*args, **kwargs)
model.load_state_dict(torch.load(PATH))
model.eval()
just when i search in google it didnt say much so just want to make sure i do it right
Hi just wonder is it possible to tell me which line did you fix my code? just when i try to imprement again same error pop up