izeeek commited on
Commit
a6f03cc
·
verified ·
1 Parent(s): e7f56c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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', weights_only=True)) # Ensure this file exists
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