From 90a7d4b1e79b9f2124bb9a36359418a3f3657782 Mon Sep 17 00:00:00 2001 From: iperov Date: Wed, 13 Mar 2019 18:30:40 +0400 Subject: [PATCH] fix force_plaidML --- nnlib/device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nnlib/device.py b/nnlib/device.py index 81164d4..67f1901 100644 --- a/nnlib/device.py +++ b/nnlib/device.py @@ -317,7 +317,7 @@ if device.backend is None and not force_tf_cpu: device.backend = None has_nvml = False -if not has_nvidia_device and (device.backend is None or force_plaidML): +if force_plaidML or (device.backend is None and not has_nvidia_device): #tensorflow backend was failed without has_nvidia_device , or forcing plaidML, trying to use plaidML backend if plaidML_devices_count == 0: #print ("plaidML: No capable OpenCL devices found. Falling back to tensorflow backend.") @@ -343,3 +343,4 @@ if device.backend is None: else: #has NVSMI, no capable CUDA-devices, also plaidML was failed, then CPU only device.backend = "tensorflow-cpu" +