tf.ConfigProto一般用在创建session的时候用来对session进行参数配置

with tf.Session(config=tf.ConfigProto(...)...)

 

tf.ConfigProto()的参数

1. log_device_placement = True    # 是否打印设备分配日志

2.allow_soft_placement = True      # 如果你指定的设备不存在, 允许TF自动分配设备

举例: tf.ConfigProto(log_device_placement = True, allow_soft_placement = True)

 

tfconfig = tf.ConfigProto()

tfconfig.gpu_options.allow_growth = True   # 如果allow_growth为truth, 分配器不会指定少量的GPU容器,然后按需慢慢增加

相关文章:

  • 2021-08-15
  • 2022-12-23
  • 2021-07-28
  • 2021-09-24
猜你喜欢
  • 2021-05-18
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案