AttributeError: ‘function‘ object has no attribute ‘to‘
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()
更多推荐
所有评论(0)