Spaces:
Sleeping
Sleeping
Update doors_fasterrcnn.py
Browse files- doors_fasterrcnn.py +1 -1
doors_fasterrcnn.py
CHANGED
|
@@ -409,7 +409,7 @@ def main_run(img_pillow,pdf_fullpath, weights_path, weights_path2, pdf_name,pdfp
|
|
| 409 |
# Load the saved model's state dictionary with map_location to handle CPU
|
| 410 |
device2 = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
| 411 |
try:
|
| 412 |
-
|
| 413 |
except RuntimeError as e:
|
| 414 |
print(f"Error loading model state_dict: {e}")
|
| 415 |
return
|
|
|
|
| 409 |
# Load the saved model's state dictionary with map_location to handle CPU
|
| 410 |
device2 = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
| 411 |
try:
|
| 412 |
+
model2.load_state_dict(torch.load(weights_path2, map_location=device2), strict=False)
|
| 413 |
except RuntimeError as e:
|
| 414 |
print(f"Error loading model state_dict: {e}")
|
| 415 |
return
|