Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ num_ftrs = model.classifier[-1].in_features # Get the number of input features
|
|
21 |
model.classifier[-1] = nn.Linear(num_ftrs, 2) # Replace with a new linear layer for binary classification
|
22 |
|
23 |
# Load the saved weights into the model
|
24 |
-
model.load_state_dict(torch.load('rice_plant_classification.pth',
|
25 |
model.eval()
|
26 |
|
27 |
# Define class labels
|
|
|
21 |
model.classifier[-1] = nn.Linear(num_ftrs, 2) # Replace with a new linear layer for binary classification
|
22 |
|
23 |
# Load the saved weights into the model
|
24 |
+
model.load_state_dict(torch.load('rice_plant_classification.pth', map_location=torch.device('cpu'))) # Ensure this file exists
|
25 |
model.eval()
|
26 |
|
27 |
# Define class labels
|