duytrq commited on
Commit
7eb8ca1
1 Parent(s): 3cbe2ea

fix bug memory leak by turn off auto shape

Browse files
Files changed (1) hide show
  1. stamp_processing/utils.py +1 -1
stamp_processing/utils.py CHANGED
@@ -24,7 +24,7 @@ def select_device(device: str = "") -> torch_device:
24
 
25
  def load_yolo_model(weight_path: str, device: str) -> Tuple[Module, int]:
26
  """Load yolov5 model from specified path using torch hub"""
27
- model = torch.hub.load(str(YOLO_DIR), "custom", path=weight_path, source="local", force_reload=True, device=device)
28
  print(weight_path)
29
  # model = torch.load(weight_path, map_location=device)["model"]
30
  # model.to(device)
 
24
 
25
  def load_yolo_model(weight_path: str, device: str) -> Tuple[Module, int]:
26
  """Load yolov5 model from specified path using torch hub"""
27
+ model = torch.hub.load(str(YOLO_DIR), "custom", path=weight_path, source="local", force_reload=True, device=device, autoshape=False)
28
  print(weight_path)
29
  # model = torch.load(weight_path, map_location=device)["model"]
30
  # model.to(device)