From ecb3436c1b1843b1b55448e1e1f813bb556e7bc8 Mon Sep 17 00:00:00 2001 From: jh Date: Wed, 17 Mar 2021 12:26:02 -0700 Subject: [PATCH] restore soft placement --- core/leras/nn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/leras/nn.py b/core/leras/nn.py index d9c5850..8ac437b 100644 --- a/core/leras/nn.py +++ b/core/leras/nn.py @@ -112,7 +112,7 @@ class nn(): config = tf.ConfigProto(device_count={'GPU': 0}) else: nn.tf_default_device = "/GPU:0" - config = tf.ConfigProto() + config = tf.ConfigProto(allow_soft_placement=True) config.gpu_options.visible_device_list = ','.join([str(device.index) for device in device_config.devices]) config.gpu_options.force_gpu_compatible = True