mirror of
https://git.mirrors.martin98.com/https://github.com/xuebinqin/U-2-Net
synced 2025-04-18 11:49:47 +08:00
Update u2net_portrait_test.py
This commit is contained in:
parent
c92b64ba0e
commit
6b2d7be4fd
@ -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