Skip to content

Commit f8a085b

Browse files
committed
Check for mask_values before popping
1 parent 5979e5d commit f8a085b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hubconf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def unet_carvana(pretrained=False, scale=0.5):
1515
else:
1616
raise RuntimeError('Only 0.5 and 1.0 scales are available')
1717
state_dict = torch.hub.load_state_dict_from_url(checkpoint, progress=True)
18-
state_dict.pop('mask_values')
18+
if 'mask_values' in state_dict:
19+
state_dict.pop('mask_values')
1920
net.load_state_dict(state_dict)
2021

2122
return net

0 commit comments

Comments
 (0)