Compare commits

...

4 Commits

Author SHA1 Message Date
Muhammad Rizwan Munawar
c23a5d0e58
Merge bf4df71924 into 1aa3688613 2025-09-14 22:51:39 +00:00
Glenn Jocher
1aa3688613
Revert "Re-enable TensorRT export in GPU tests" (#22078)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
2025-09-14 23:21:11 +01:00
Ultralytics Assistant
bf4df71924
Merge branch 'main' into imp-dowd 2025-09-06 20:55:58 +02:00
RizwanMunawar
c80c9b74a6 auto-redownload corrupted model weights in torch_safe_load 2025-09-05 17:29:59 +05:00
4 changed files with 9 additions and 4 deletions

View File

@ -150,9 +150,10 @@ Note: This works using LLMs under the hood so the results are probabilistic and
!!! example "Ask AI"
```python
from ultralytics import Explorer
from ultralytics.data.explorer import plot_query_result
from ultralytics import Explorer
# create an Explorer object
exp = Explorer(data="coco128.yaml", model="yolo11n.pt")
exp.create_embeddings_table()

View File

@ -116,7 +116,6 @@ Image.fromarray(plt)
```python
# plot
from PIL import Image
from ultralytics.data.explorer import plot_query_result
plt = plot_query_result(exp.ask_ai("show me 10 images containing exactly 2 persons"))

View File

@ -68,7 +68,7 @@ def test_export_onnx_matrix(task, dynamic, int8, half, batch, simplify, nms):
half=half,
batch=batch,
simplify=simplify,
nms=nms,
nms=nms and task != "obb", # WARNING: Failing NMS with OBB
device=DEVICES[0],
)
YOLO(file)([SOURCE] * batch, imgsz=64 if dynamic else 32, device=DEVICES[0]) # exported model inference
@ -76,6 +76,7 @@ def test_export_onnx_matrix(task, dynamic, int8, half, batch, simplify, nms):
@pytest.mark.slow
@pytest.mark.skipif(True, reason="WARNING: Failing TensorRT export tests")
@pytest.mark.skipif(not DEVICES, reason="No CUDA devices available")
@pytest.mark.parametrize(
"task, dynamic, int8, half, batch",

View File

@ -1446,7 +1446,11 @@ def torch_safe_load(weight, safe_only=False):
with open(file, "rb") as f:
ckpt = torch_load(f, pickle_module=safe_pickle)
else:
ckpt = torch_load(file, map_location="cpu")
try:
ckpt = torch_load(file, map_location="cpu")
except Exception:
Path(file).unlink(missing_ok=True) # file broken → delete
ckpt = torch_load(attempt_download_asset(weight), map_location="cpu") # re-download
except ModuleNotFoundError as e: # e.name is missing module name
if e.name == "models":