mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 13:32:09 -07:00
nnlib initialization: fix choosing best gpu when indexes of gpu are different in tf and nvsmi
This commit is contained in:
parent
4a2203cc35
commit
8041ee959a
1 changed files with 2 additions and 2 deletions
|
@ -148,13 +148,13 @@ NLayerDiscriminator = nnlib.NLayerDiscriminator
|
||||||
|
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
nnlib.tf = tf
|
nnlib.tf = tf
|
||||||
|
|
||||||
if device_config.cpu_only:
|
if device_config.cpu_only:
|
||||||
config = tf.ConfigProto(device_count={'GPU': 0})
|
config = tf.ConfigProto(device_count={'GPU': 0})
|
||||||
else:
|
else:
|
||||||
config = tf.ConfigProto()
|
config = tf.ConfigProto()
|
||||||
|
|
||||||
if device_config.backend != "tensorflow-generic":
|
if device_config.force_gpu_idx != -1 and device_config.backend != "tensorflow-generic":
|
||||||
#tensorflow-generic is system with NVIDIA card, but w/o NVSMI
|
#tensorflow-generic is system with NVIDIA card, but w/o NVSMI
|
||||||
#so dont hide devices and let tensorflow to choose best card
|
#so dont hide devices and let tensorflow to choose best card
|
||||||
visible_device_list = ''
|
visible_device_list = ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue