Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def load_the_model():
|
|
34 |
x = self.fc3(x)
|
35 |
return x
|
36 |
|
37 |
-
loaded_model = Net()
|
38 |
loaded_model.load_state_dict(torch.load(path_of_model))
|
39 |
loaded_model.eval()
|
40 |
return loaded_model
|
@@ -86,7 +86,7 @@ def predict_on_base64(model, base64_file):
|
|
86 |
custom_image_transformed_with_batch_size = custom_image_transformed.unsqueeze(dim=0)
|
87 |
|
88 |
# Make a prediction on image with an extra dimension
|
89 |
-
custom_image_pred = model(custom_image_transformed_with_batch_size.to(device)
|
90 |
# Getting the probs
|
91 |
prob = torch.softmax(custom_image_pred, dim=1)
|
92 |
# Getting the sample prob
|
|
|
34 |
x = self.fc3(x)
|
35 |
return x
|
36 |
|
37 |
+
loaded_model = Net()#.to(device)
|
38 |
loaded_model.load_state_dict(torch.load(path_of_model))
|
39 |
loaded_model.eval()
|
40 |
return loaded_model
|
|
|
86 |
custom_image_transformed_with_batch_size = custom_image_transformed.unsqueeze(dim=0)
|
87 |
|
88 |
# Make a prediction on image with an extra dimension
|
89 |
+
custom_image_pred = model(custom_image_transformed_with_batch_size) # .to(device)
|
90 |
# Getting the probs
|
91 |
prob = torch.softmax(custom_image_pred, dim=1)
|
92 |
# Getting the sample prob
|