antonovmaxim commited on
Commit
b4908a3
·
1 Parent(s): ecf77f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
7
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
8
  model = torch.hub.load("pytorch/vision", "resnet101", pretrained=False)
9
  model.fc = nn.Sequential(nn.Linear(2048, 500), nn.ReLU(), nn.Linear(500, 2), nn.Softmax(1))
10
- state_dict = torch.load('model.pth', map_location=torch.device('cpu'))
11
  model.load_state_dict(state_dict)
12
  model.to(device)
13
  model.eval()
 
7
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
8
  model = torch.hub.load("pytorch/vision", "resnet101", pretrained=False)
9
  model.fc = nn.Sequential(nn.Linear(2048, 500), nn.ReLU(), nn.Linear(500, 2), nn.Softmax(1))
10
+ state_dict = torch.load('model.pth', map_location=device)
11
  model.load_state_dict(state_dict)
12
  model.to(device)
13
  model.eval()