Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
f175abc3
Unverified
Commit
f175abc3
authored
Oct 24, 2018
by
Taylor Robie
Committed by
GitHub
Oct 24, 2018
Browse files
Move version check to a function (#5601)
* move version check to a function * delint * tweak pip check * delint
parent
d7676c1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
official/utils/logs/mlperf_helper.py
official/utils/logs/mlperf_helper.py
+14
-11
No files found.
official/utils/logs/mlperf_helper.py
View file @
f175abc3
...
@@ -86,19 +86,22 @@ def unparse_line(parsed_line): # type: (ParsedLine) -> str
...
@@ -86,19 +86,22 @@ def unparse_line(parsed_line): # type: (ParsedLine) -> str
def
get_mlperf_log
():
def
get_mlperf_log
():
"""Shielded import of mlperf_log module."""
"""Shielded import of mlperf_log module."""
try
:
try
:
import
pkg_resources
import
mlperf_compliance
import
mlperf_compliance
version
=
pkg_resources
.
get_distribution
(
"mlperf_compliance"
)
def
test_mlperf_log_pip_version
():
version
=
tuple
(
int
(
i
)
for
i
in
version
.
version
.
split
(
"."
))
"""Check that mlperf_compliance is up to date."""
if
version
<
_MIN_VERSION
:
import
pkg_resources
tf
.
logging
.
warning
(
version
=
pkg_resources
.
get_distribution
(
"mlperf_compliance"
)
"mlperf_compliance is version {}, must be at least version {}"
.
format
(
version
=
tuple
(
int
(
i
)
for
i
in
version
.
version
.
split
(
"."
))
"."
.
join
([
str
(
i
)
for
i
in
version
]),
if
version
<
_MIN_VERSION
:
"."
.
join
([
str
(
i
)
for
i
in
_MIN_VERSION
])))
tf
.
logging
.
warning
(
raise
ImportError
"mlperf_compliance is version {}, must be >= {}"
.
format
(
"."
.
join
([
str
(
i
)
for
i
in
version
]),
mlperf_log
=
mlperf_compliance
.
mlperf_log
"."
.
join
([
str
(
i
)
for
i
in
_MIN_VERSION
])))
raise
ImportError
return
mlperf_compliance
.
mlperf_log
mlperf_log
=
test_mlperf_log_pip_version
()
except
ImportError
:
except
ImportError
:
mlperf_log
=
None
mlperf_log
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment