Skip to content

Commit 3a022c0

Browse files
author
Yadan Wei
committed
fix testTensorFlow and test TensorBoard script
1 parent 3c88074 commit 3a022c0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/dlc_tests/container_tests/bin/testTensorBoard

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ BIN_DIR=${HOME_DIR}/bin
88
# Use this to conditionally check TF version
99
pip install packaging
1010
if [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_tf27_or_greater_not_tf218 = Version(tf.__version__) >= Version('2.7') and Version(tf.__version__) != Version('2.18.0'); print(is_tf27_or_greater_not_tf218)") == 'True' ]]; then
11-
PROFILER_LOG_DIR="/logs/plugins/profile"
11+
LOG_DIR="/logs/plugins/profile"
1212
else
13-
PROFILER_LOG_DIR="/logs/train/plugins/profile"
13+
LOG_DIR="/logs/train/plugins/profile"
1414
fi
1515

1616
[ -d $LOG_DIR ] && echo "Cleanning existing logs" && rm -rf $LOG_DIR
@@ -19,15 +19,15 @@ python ${BIN_DIR}/testTensorBoard.py || exit 1
1919

2020
# profiler: tf > 2.* and < 2.2 generates local.trace where as tf > 2.2 generates *.pb and tf2.18 generate timestamp folder under /logs/train/plugins/profile
2121
if [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_less_than_tf22 = Version(tf.__version__) < Version('2.2'); print(is_less_than_tf22)") == 'True' ]]; then
22-
LOG_RESULT=$(find $PROFILER_LOG_DIR -name "local.trace")
23-
else if [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_equal_tf218 = Version(tf.__version__) == Version('2.18'); print(is_equal_tf218)") == 'True' ]]; then
24-
LOG_RESULT=$(find $PROFILER_LOG_DIR -wholename "**/*.pb")
22+
LOG_RESULT=$(find $LOG_DIR -name "local.trace")
23+
elif [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_equal_tf218 = Version(tf.__version__) == Version('2.18'); print(is_equal_tf218)") == 'True' ]]; then
24+
LOG_RESULT=$(find $LOG_DIR -wholename "**/*.pb")
2525
else
26-
LOG_RESULT=$(find $PROFILER_LOG_DIR -name "*.pb")
26+
LOG_RESULT=$(find $LOG_DIR -name "*.pb")
2727
fi
2828

2929
echo "Checking the logs result: $LOG_RESULT"
3030

3131
[ -z "$LOG_RESULT" ] && echo "Cannot find Profiler logs!" && exit 1
3232

33-
exit 0
33+
exit 0

test/dlc_tests/container_tests/bin/testTensorFlow

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ echo "Verify tensorflow profiler can generate logs."
5050
# profiler: tf > 2.* and < 2.2 generates local.trace where as tf > 2.2 generates *.pb and tf2.18 generate timestamp folder under /logs/train/plugins/profile
5151
if [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_less_than_tf22 = Version(tf.__version__) < Version('2.2'); print(is_less_than_tf22)") == 'True' ]]; then
5252
LOG_RESULT=$(find $PROFILER_LOG_DIR -name "local.trace")
53-
else if [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_equal_tf218 = Version(tf.__version__) == Version('2.18'); print(is_equal_tf218)") == 'True' ]]; then
53+
elif [[ $(python -c "import tensorflow as tf; from packaging.version import Version; is_equal_tf218 = Version(tf.__version__) == Version('2.18'); print(is_equal_tf218)") == 'True' ]]; then
5454
LOG_RESULT=$(find $PROFILER_LOG_DIR -wholename "**/*.pb")
5555
else
5656
LOG_RESULT=$(find $PROFILER_LOG_DIR -name "*.pb")

0 commit comments

Comments
 (0)