diff --git a/CHANGELOG.md b/CHANGELOG.md index c17e398a02..8d7b6d86ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A base class for dataset validation plugins () ### Changed -- +- Tensorflow AVX check is made optional in API and is disabled by default () ### Deprecated - diff --git a/datumaro/util/tf_util.py b/datumaro/util/tf_util.py index 9eda97bab9..a185704e52 100644 --- a/datumaro/util/tf_util.py +++ b/datumaro/util/tf_util.py @@ -4,6 +4,8 @@ # SPDX-License-Identifier: MIT +enable_tf_check = False + def check_import(): # Workaround for checking import availability: # Official TF builds include AVX instructions. Once we try to import, @@ -32,7 +34,7 @@ def check_import(): raise ImportError(message) -def import_tf(check=True): +def import_tf(check=None): import sys not_found = object() @@ -46,6 +48,9 @@ def import_tf(check=True): import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' + if check is None: + check = enable_tf_check + if check: try: check_import()