Skip to content

Commit 3f6e079

Browse files
author
Lee Yang
committed
use list_physical_devices to avoid runtime initialization
1 parent c236511 commit 3f6e079

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

tensorflowonspark/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ def is_gpu_available():
2626
if version.parse(tf.__version__) < version.parse('2.1.0'):
2727
return tf.test.is_built_with_cuda()
2828
else:
29-
return len(tf.config.list_logical_devices('GPU')) > 0
29+
return len(tf.config.list_physical_devices('GPU')) > 0

test/test_pipeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def _spark_train(args, ctx):
9494
import tensorflow as tf
9595
from tensorflowonspark import TFNode
9696

97-
tf.compat.v1.disable_eager_execution()
9897
tf.compat.v1.reset_default_graph()
9998
strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy()
10099

0 commit comments

Comments
 (0)