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_test.py
This commit is contained in:
parent
6b2d7be4fd
commit
4ea81c2f21
@ -84,10 +84,7 @@ def main():
|
||||
elif(model_name=='u2netp'):
|
||||
print("...load U2NEP---4.7 MB")
|
||||
net = U2NETP(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