Skip to content

Commit b2d4ae9

Browse files
committed
Fix "Not creating XLA devices, tf_xla_enable_xla_devices not set"
1 parent 895f81d commit b2d4ae9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/train.py

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ def trainlog(s):
152152
multi_gpu_device_ids.append("/GPU:" + str(int(piece)))
153153
num_gpus_used = len(multi_gpu_device_ids)
154154

155+
# Fix for tensorflow 2.4: Not creating XLA devices, tf_xla_enable_xla_devices not set
156+
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
157+
155158

156159
# MODEL ----------------------------------------------------------------
157160
printed_model_yet = False

0 commit comments

Comments
 (0)