Skip to content

Commit de08806

Browse files
authored
load weights to cpu by default
1 parent a983364 commit de08806

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

efficientdet_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@
5858

5959
model = EfficientDetBackbone(compound_coef=compound_coef, num_classes=len(obj_list),
6060
ratios=anchor_ratios, scales=anchor_scales)
61-
if use_cuda:
62-
model.load_state_dict(torch.load(f'weights/efficientdet-d{compound_coef}.pth'))
63-
else:
64-
model.load_state_dict(torch.load(f'weights/efficientdet-d{compound_coef}.pth', map_location=torch.device('cpu')))
61+
model.load_state_dict(torch.load(f'weights/efficientdet-d{compound_coef}.pth', map_location='cpu'))
6562
model.requires_grad_(False)
6663
model.eval()
6764

0 commit comments

Comments
 (0)