From 73228e6c950c7881f4f9d0a7236539b30c38f275 Mon Sep 17 00:00:00 2001 From: Matthew Franglen Date: Mon, 1 Nov 2021 22:00:59 +0000 Subject: [PATCH] Compare version using integers pytorch version 1.10 has been released and this causes the version check to erroneously fail. This fixes that comparison. >>> [1, 10, 0] < [1, 7, 1] False >>> ["1", "10", "0"] < ["1", "7", "1"] True --- clip/clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clip/clip.py b/clip/clip.py index 9d6f4d6..e2cbe00 100644 --- a/clip/clip.py +++ b/clip/clip.py @@ -19,7 +19,7 @@ except ImportError: BICUBIC = Image.BICUBIC -if torch.__version__.split(".") < ["1", "7", "1"]: +if [int(v) for v in torch.__version__.split(".")] < [1, 7, 1]: warnings.warn("PyTorch version 1.7.1 or higher is recommended")