【问题标题】:TensorFlow: No allowing GPU memory growth option in contrib.learn. EstimatorTensorFlow:contrib.learn 中不允许 GPU 内存增长选项。估计器
【发布时间】:2017-08-01 22:03:35
【问题描述】:

使用 contrib.learn 创建估算器时,我能找到的唯一 GPU 选项是“gpu_memory_fraction”,可以在“tf.contrib.learn.RunConfig”中找到

classifier = learn.Estimator(
     model_fn=cnn_model_fn,
     config=learn.RunConfig(
           gpu_memory_fraction=0.9
           )
     )

有没有办法在使用 contrib.learn 时允许 GPU 内存增长选项?

【问题讨论】:

    标签: memory tensorflow gpu config


    【解决方案1】:
    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    config.gpu_options.per_process_gpu_memory_fraction = 0.9
    run_config = tf.contrib.learn.RunConfig(session_config=config)
    

    将以上配置传递给Estimator's session_config

    【讨论】:

      猜你喜欢
      • 2019-05-17
      • 2021-05-18
      • 2020-08-16
      • 2023-02-20
      • 2014-12-13
      • 2022-07-26
      • 2014-12-11
      • 2015-06-15
      • 2016-12-28
      相关资源
      最近更新 更多