Skip to content

Commit de80f92

Browse files
author
Shibo Xing
committed
fix: use Version packaging to compare version
1 parent cd4f507 commit de80f92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sagemaker/image_uris.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
from typing import Optional
21+
from packaging.version import Version
2122

2223
from sagemaker import utils
2324
from sagemaker.jumpstart.utils import is_jumpstart_model_input
@@ -371,7 +372,7 @@ def _validate_instance_deprecation(framework, instance_type, version):
371372
if (
372373
framework == "pytorch"
373374
and _get_instance_type_family(instance_type) == "p2"
374-
and version >= "1.13"
375+
and Version(version) >= Version("1.13")
375376
):
376377
raise ValueError(
377378
"P2 instances have been deprecated for sagemaker jobs with PyTorch 1.13 and above. "

0 commit comments

Comments
 (0)