Skip to content

Commit 564a7a2

Browse files
committed
.
1 parent 1ed67dd commit 564a7a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roboflow/util/model_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
123123
"or through the Roboflow platform"
124124
)
125125

126-
model = torch.load(os.path.join(model_path, filename), map_location="cpu", weights_only=False)
126+
model = torch.load(os.path.join(model_path, filename), weights_only=False)
127127

128128
model_instance = model["model"] if "model" in model and model["model"] is not None else model["ema"]
129129

@@ -138,7 +138,7 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
138138

139139
if "yolov8" in model_type or "yolov10" in model_type or "yolov11" in model_type or "yolov12" in model_type:
140140
# try except for backwards compatibility with older versions of ultralytics
141-
if "-cls" in model_type or model_type.startswith("yolov10") or model_type.startswith("yolov11"):
141+
if "-cls" in model_type or model_type.startswith("yolov10") or model_type.startswith("yolov11") or model_type.startswith("yolov12"):
142142
nc = model_instance.yaml["nc"]
143143
args = model["train_args"]
144144
else:

0 commit comments

Comments
 (0)