made changes to model loading
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ model.to(device) # Move model to CPU (even if you have a GPU)
|
|
36 |
checkpoint = torch.load('model.pth', map_location='cpu')
|
37 |
|
38 |
# Load the model weights
|
39 |
-
model.load_state_dict(checkpoint['model_state_dict'])
|
40 |
|
41 |
# If you need to resume training, load optimizer and scheduler states
|
42 |
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|
|
|
36 |
checkpoint = torch.load('model.pth', map_location='cpu')
|
37 |
|
38 |
# Load the model weights
|
39 |
+
model.load_state_dict(checkpoint['model_state_dict'], strict=False)
|
40 |
|
41 |
# If you need to resume training, load optimizer and scheduler states
|
42 |
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|