So the Session config proto has a device_filters option, with the comment:
// When any filters are present sessions will ignore all devices which do not
// match the filters. Each filter can be partially specified, e.g. "/job:ps"
// "/job:worker/replica:3", etc.
Does anyone have concrete explanation of the format? For example, I want to exclude /gpu:0 as an option because I use it for running other models.
I've 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'm still getting ops allocated to gpu 0. I don't want to override the devices on a per-op basis.