mirror of https://github.com/ZHKKKe/MODNet.git
removed unnecessary flag
parent
9956841ea4
commit
73f4b49457
|
|
@ -45,12 +45,11 @@ if __name__ == '__main__':
|
||||||
# create MODNet and load the pre-trained ckpt
|
# create MODNet and load the pre-trained ckpt
|
||||||
modnet = MODNet(backbone_pretrained=False)
|
modnet = MODNet(backbone_pretrained=False)
|
||||||
modnet = nn.DataParallel(modnet)
|
modnet = nn.DataParallel(modnet)
|
||||||
cpu_mode = False
|
|
||||||
if torch.cuda.is_available():
|
if torch.cuda.is_available():
|
||||||
modnet = modnet.cuda()
|
modnet = modnet.cuda()
|
||||||
weights = torch.load(args.ckpt_path)
|
weights = torch.load(args.ckpt_path)
|
||||||
else:
|
else:
|
||||||
cpu_mode = True
|
|
||||||
weights = torch.load(args.ckpt_path, map_location=torch.device('cpu'))
|
weights = torch.load(args.ckpt_path, map_location=torch.device('cpu'))
|
||||||
modnet.load_state_dict(weights)
|
modnet.load_state_dict(weights)
|
||||||
modnet.eval()
|
modnet.eval()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue