Fix PyTorch version check for nightly builds

Example: `1.10.0.dev20210803+cu111`
This commit is contained in:
Tan Jia Huei 2021-11-05 13:09:40 +08:00
parent 2867559c5f
commit 0c7a6d3b16
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ except ImportError:
BICUBIC = Image.BICUBIC
if [int(n.split("+")[0]) for n in torch.__version__.split(".")] < [1, 7, 1]:
if [int(n.split("+")[0]) for n in torch.__version__.split(".")[:3]] < [1, 7, 1]:
warnings.warn("PyTorch version 1.7.1 or higher is recommended")