For a university project, we have to create a certain accuracy level for the famous Fashion MNIST with model of neural network.
I am having some issues to somehow connect the test version to the train version. I am trying to save a the best version to then load it again to evaluate:
I am trying to do this code but I can’t get it right.
model = FashionMNISTNet(*images, **labels)
model.load_state_dict(torch.load(os.path.join))
model.eval()
TypeError Traceback (most recent call last)
in ()
----> 1 model = FashionMNISTNet(*images, **labels)
2 model.load_state_dict(torch.load(os.path.join))
3 model.eval()
TypeError: type object argument after ** must be a mapping, not Tensor
Is FashionMNISTNet a subclass of torch.nn.Module? If so it is a bit strange to pass images and labels to the __init__ function as usually the model definition itself doesn’t need to know anything about the data.
Can you show what the definition of FashionMNISTNet looks like?
The Imagenet Example also gives an example of how to use the model loading functions.
It seems like you shouldn’t need to pass images or labels to the constructor; you can just call FashionMNISTNet with any arguments (e.g., model = FashionMNISTNet()).