tryint to use the test after I load the model
net = net.load_state_dict(torch.load(PATH))
net.eval()
but this spit the error
net.eval() AttributeError: '_IncompatibleKeys' object has no attribute 'eval'
here you don't need to assign net.load_state_dict to net
net = net.load_state_dict(torch.load(PATH))
just used
net.load_state_dict(torch.load(PATH))
net.eval()
more see Recommended approach for saving a model
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With