mirror of
https://git.mirrors.martin98.com/https://github.com/xuebinqin/U-2-Net
synced 2025-08-17 12:35:52 +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.load_state_dict(torch.load(model_dir))
|
||||||
net.cuda()
|
net.cuda()
|
||||||
else:
|
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()
|
net.eval()
|
||||||
|
|
||||||
# --------- 4. inference for each image ---------
|
# --------- 4. inference for each image ---------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user