From 61c8ea634257042e9f0546fe492019a75386a927 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 15 Feb 2026 19:36:16 -0800 Subject: [PATCH] Add torchvision upgrade hint to mismatch ImportError (#4067) Co-authored-by: Daniel Hanchen --- unsloth/import_fixes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/unsloth/import_fixes.py b/unsloth/import_fixes.py index c7914f39a1..a86ad84779 100644 --- a/unsloth/import_fixes.py +++ b/unsloth/import_fixes.py @@ -689,6 +689,7 @@ def torchvision_compatibility_check(): f"Unsloth: torch=={torch_version_raw} requires " f"torchvision>={required_tv_str}, " f"but found torchvision=={torchvision_version_raw}. " + f'Try updating torchvision via `pip install --upgrade "torchvision>={required_tv_str}"`. ' f"Please refer to https://pytorch.org/get-started/previous-versions/ " f"for more information." )