What do the options in ConfigProto like allow_soft_placement and log_device_placement mean?

后端 未结 4 1705
攒了一身酷
攒了一身酷 2020-12-13 06:24

We see this quite often in many of the TensorFlow tutorials:

sess = tf.Session(config=tf.ConfigProto(allow_soft_placem         


        
4条回答
  •  抹茶落季
    2020-12-13 07:09

    allow_soft_placement

    This option allows resilient device assignment, but it only works when your tensorflow is not GPU compiled. If your tensorflow is GPU supported the operations always perform on GPU no matter if allow_soft_placement is set or not and even if you set device as CPU. But if you set it as false and device as GPU but GPU cannot be found in your machine it raises error.

    log_device_placement

    This config tells you which device the operation is allocated while building the graph. It can always find the prioritized device with best performance on you machine. It seems just to ignore your settings.

提交回复
热议问题