mirror of
https://git.mirrors.martin98.com/https://github.com/xuebinqin/U-2-Net
synced 2025-08-05 16:50:40 +08:00
Update u2net_portrait_test.py
This commit is contained in:
parent
21bc4de1f3
commit
f893106780
@ -84,10 +84,7 @@ def main():
|
||||
print("...load U2NET---173.6 MB")
|
||||
net = U2NET(3,1)
|
||||
|
||||
if torch.cuda.is_available():
|
||||
net.load_state_dict(torch.load(model_dir))
|
||||
else:
|
||||
net.load_state_dict(torch.load(model_dir, map_location=torch.device('cpu')))
|
||||
net.load_state_dict(torch.load(model_dir))
|
||||
if torch.cuda.is_available():
|
||||
net.cuda()
|
||||
net.eval()
|
||||
|
Loading…
x
Reference in New Issue
Block a user