Skip to content

Commit 976af37

Browse files
committed
load torch and ultralytics
1 parent 1984f1d commit 976af37

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

roboflow/util/model_processor.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
108108
print_warn_for_wrong_dependencies_versions([("ultralytics", ">=", "8.3.0")], ask_to_continue=True)
109109

110110
elif "yolov12" in model_type:
111+
try:
112+
import torch
113+
import ultralytics
114+
115+
except ImportError:
116+
raise RuntimeError(
117+
"The ultralytics python package is required to deploy yolov12"
118+
" models. Please install it with `pip install ultralytics`"
119+
)
120+
111121
print(
112122
"Note: Model must be trained using ultralytics from https://github.com/sunsmarterjie/yolov12 "
113123
"or through the Roboflow platform"

0 commit comments

Comments
 (0)