czkaiweb commited on
Commit
4eda6d9
1 Parent(s): e1d5e6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -18,6 +18,13 @@ device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cp
18
  model = model.to(device)
19
  model.load_state_dict(torch.load('model_weights_EfficientNetB0_final.pth',map_location=device))
20
 
 
 
 
 
 
 
 
21
  #torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
22
 
23
 
 
18
  model = model.to(device)
19
  model.load_state_dict(torch.load('model_weights_EfficientNetB0_final.pth',map_location=device))
20
 
21
+
22
+ model = models.vgg16()
23
+ num_ftrs = model.classifier[6].in_features
24
+ model.classifier[6] = nn.Linear(num_ftrs, 6)
25
+ device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
26
+ #model = model.to(device)
27
+ model.load_state_dict(torch.load('VGG16_weights_May28.pth',map_location=device))
28
  #torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
29
 
30