Tensorflow crashes with CUBLAS_STATUS_ALLOC_FAILED

前端 未结 10 1200
醉梦人生
醉梦人生 2020-12-03 00:43

I\'m running tensorflow-gpu on Windows 10 using a simple MINST neural network program. When it tries to run, it encounters a CUBLAS_STATUS_ALLOC_FAILED error. A

10条回答
  •  长情又很酷
    2020-12-03 01:50

    Tensorflow 2.0 alpha

    Allowing GPU memory growth may fix this issue. For Tensorflow 2.0 alpha / nightly there are two methods you can try, to archive this.

    1.)

    import tensorflow as tf
    tf.config.gpu.set_per_process_memory_growth()
    

    2.)

    import tensorflow as tf
    tf.config.gpu.set_per_process_memory_fraction(0.4) # adjust this to the % of VRAM you 
                                                       # want to give to tensorflow.
    

    I suggest you try both, and see if it helps. Source: https://www.tensorflow.org/alpha/guide/using_gpu

提交回复
热议问题