AttributeError: ‘function‘ object has no attribute ‘to‘

net.eval.to(device)

AttributeError: 'function' object has no attribute 'to'

原:

model=model.load_state_dict(torch.load("bestmodel.pth"))
model=model.to(device)# Or the following 
model.eval()

改为:

model.load_state_dict(torch.load("bestmodel.pth"))
model=model.to(device)# Or the following 
model.eval()

你可能感兴趣的:(java,servlet,jvm)