fix bug memory leak by turn off auto shape
Browse files
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)
|