Marthee commited on
Commit
a1c91fe
·
verified ·
1 Parent(s): cd1f6d2

Update doors_fasterrcnn.py

Browse files
Files changed (1) hide show
  1. doors_fasterrcnn.py +1 -1
doors_fasterrcnn.py CHANGED
@@ -176,7 +176,7 @@ def main_run(pdf_fullpath, weights_path, pdf_name):
176
  # Load the saved model's state dictionary with map_location to handle CPU
177
  device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
178
  # model.load_state_dict(torch.load(weights_path, map_location=device))
179
- model.load_state_dict(torch.load(weights_path, map_location=torch.device('cpu')))
180
  # Set the model to evaluation mode
181
  model.eval()
182
  # Move the model to the appropriate device
 
176
  # Load the saved model's state dictionary with map_location to handle CPU
177
  device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
178
  # model.load_state_dict(torch.load(weights_path, map_location=device))
179
+ model.load_state_dict(torch.load(weights_path, map_location=device), strict=False)
180
  # Set the model to evaluation mode
181
  model.eval()
182
  # Move the model to the appropriate device