How can I solve 'ran out of gpu memory' in TensorFlow

后端 未结 8 1604
你的背包
你的背包 2020-12-04 10:46

I ran the MNIST demo in TensorFlow with 2 conv layers and a full-conect layer, I got an message that \'ran out of memeory trying to allocate 2.59GiB\' , but it shows that to

8条回答
  •  无人及你
    2020-12-04 11:45

    For Tensorflow 2:

    config = tf.compat.v1.ConfigProto()
    config.gpu_options.allow_growth = True
    session = tf.compat.v1.Session(config=config)
    

提交回复
热议问题