Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from icevision.all import *
|
|
3 |
|
4 |
class_map = ClassMap(['disk'])
|
5 |
model = models.torchvision.faster_rcnn.model(backbone=models.torchvision.faster_rcnn.backbones.resnet18_fpn(pretrained=True),num_classes=len(class_map))
|
6 |
-
state_dict = torch.load('fasterRCNNDisc.pth')
|
7 |
model.load_state_dict(state_dict)
|
8 |
|
9 |
infer_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(384),tfms.A.Normalize()])
|
|
|
3 |
|
4 |
class_map = ClassMap(['disk'])
|
5 |
model = models.torchvision.faster_rcnn.model(backbone=models.torchvision.faster_rcnn.backbones.resnet18_fpn(pretrained=True),num_classes=len(class_map))
|
6 |
+
state_dict = torch.load('fasterRCNNDisc.pth',map_location=torch.device('cpu'))
|
7 |
model.load_state_dict(state_dict)
|
8 |
|
9 |
infer_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(384),tfms.A.Normalize()])
|