-
Notifications
You must be signed in to change notification settings - Fork 43
Possible bug in Tensorflow version check #28
Copy link
Copy link
Open
Description
Hi, utils.misc_utils.check_tensorflow_version() results in an error if one uses say version 1.15. See the version history here.
def check_tensorflow_version():
if tf.__version__ < "1.2.1":
raise EnvironmentError("Tensorflow version must >= 1.2.1")
The code can be updated to:
def check_tensorflow_version():
def compare_version(version1, version2):
nums1 = version1.split('.')
nums2 = version2.split('.')
n1, n2 = len(nums1), len(nums2)
# compare versions
for i in range(max(n1, n2)):
i1 = int(nums1[i]) if i < n1 else 0
i2 = int(nums2[i]) if i < n2 else 0
if i1 != i2:
return True if i1 > i2 else False
# the versions are equal
return False
if not compare_version(tf.__version__, "1.2.1"):
raise EnvironmentError("Tensorflow version must >= 1.2.1")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

