CUDA_ERROR_OUT_OF_MEMORY in tensorflow

后端 未结 6 2022
盖世英雄少女心
盖世英雄少女心 2020-12-04 19:43

When I started to train some neural network, it met the CUDA_ERROR_OUT_OF_MEMORY but the training could go on without error. Because I wanted to use gpu memory

6条回答
  •  渐次进展
    2020-12-04 20:10

    Tensorflow 2.0 alpha

    The problem is, that Tensorflow is greedy in allocating all available VRAM. That causes issues for some people.

    For Tensorflow 2.0 alpha / nightly use this:

    import tensorflow as tf
    tf.config.gpu.set_per_process_memory_fraction(0.4)
    

    Source: https://www.tensorflow.org/alpha/guide/using_gpu

提交回复
热议问题