Thus, the session configuration protocol has the device_filters option, with a comment:
// When any filters are present sessions will ignore all devices which do not // match the filters. Each filter can be partially specified, eg "/job:ps" // "/job:worker/replica:3", etc.
Does anyone have a specific explanation for the format? For example, I want to exclude / gpu: 0 as an option, because I use it to run other models.
I tried
config = tf.ConfigProto() config.device_filters.append('/gpu:1') config.device_filters.append('/cpu:0') with tf.Session(config=config): # Do stuff
But I still get ops assigned by gpu 0. I don't want to redefine op-op based devices.
python tensorflow
N. McA.
source share