mirror of
https://git.mirrors.martin98.com/https://github.com/xuebinqin/U-2-Net
synced 2025-08-16 12:15:53 +08:00
map location to work on torch < 4.0.1
This commit is contained in:
parent
1b247c5419
commit
4031385d80
@ -88,7 +88,7 @@ def main():
|
||||
net.load_state_dict(torch.load(model_dir))
|
||||
net.cuda()
|
||||
else:
|
||||
net.load_state_dict(torch.load(model_dir, map_location=torch.device('cpu')))
|
||||
net.load_state_dict(torch.load(model_dir, map_location='cpu'))
|
||||
net.eval()
|
||||
|
||||
# --------- 4. inference for each image ---------
|
||||
|
Loading…
x
Reference in New Issue
Block a user