We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4272fd0 commit a983364Copy full SHA for a983364
efficientdet_test.py
@@ -58,7 +58,10 @@
58
59
model = EfficientDetBackbone(compound_coef=compound_coef, num_classes=len(obj_list),
60
ratios=anchor_ratios, scales=anchor_scales)
61
-model.load_state_dict(torch.load(f'weights/efficientdet-d{compound_coef}.pth'))
+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')))
65
model.requires_grad_(False)
66
model.eval()
67
0 commit comments