【问题标题】:Not enough GPU memory when training small model (< 100 mb) in tensorflow在张量流中训练小型模型(< 100 mb)时没有足够的 GPU 内存
【发布时间】:2017-03-16 07:17:30
【问题描述】:

在 tensorflow 中训练小型模型(

【问题讨论】:

  • 减少批处理大小并使用时间线查看内存的去向 (tl.generate_chrome_trace_format(show_memory=True..))

标签: tensorflow gpu


【解决方案1】:

默认情况下,张量流可以增长到所有 GPU 内存的总和。 您可以通过为 Session 设置配置来限制它:

gpu_memory_fraction = 0.4 # Fraction of GPU memory to use
config = tf.ConfigProto(gpu_options=
                       tf.GPUOptions(per_process_gpu_memory_fraction=gpu_memory_fraction))                          
sess = tf.Session(config=config)

【讨论】:

    猜你喜欢
    • 2022-06-23
    • 1970-01-01
    • 2021-12-24
    • 1970-01-01
    • 1970-01-01
    • 2017-09-22
    • 2023-03-12
    • 2020-02-29
    • 1970-01-01
    相关资源
    最近更新 更多