Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -223,7 +223,15 @@ def run_diagnosis(backbone_name, input_image, preprocess_fn = None, Idx2labels=N
|
|
| 223 |
# Generate predictions
|
| 224 |
output_logits = model(input_tensor).cpu()
|
| 225 |
|
| 226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
|
| 228 |
output_probs = dict()
|
| 229 |
predicted_classes = []
|
|
|
|
| 223 |
# Generate predictions
|
| 224 |
output_logits = model(input_tensor).cpu()
|
| 225 |
|
| 226 |
+
# File "/app/app.py", line 226, in run_diagnosis
|
| 227 |
+
# probabilities = torch.sigmoid(output_logits)[0].numpy().tolist()
|
| 228 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
|
| 229 |
+
# RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
|
| 230 |
+
|
| 231 |
+
# ylogit = model(newimg).detach()
|
| 232 |
+
# yprob = torch.sigmoid(ylogit)
|
| 233 |
+
|
| 234 |
+
probabilities = torch.sigmoid(output_logits)[0].detach().numpy().tolist()
|
| 235 |
|
| 236 |
output_probs = dict()
|
| 237 |
predicted_classes = []
|