Tensorflow Allocation Memory: Allocation of 38535168 exceeds 10% of system memory

前端 未结 6 1196
盖世英雄少女心
盖世英雄少女心 2020-12-08 04:45

Using ResNet50 pre-trained Weights I am trying to build a classifier. The code base is fully implemented in Keras high-level Tensorflow API. The complete code is posted in t

6条回答
  •  伪装坚强ぢ
    2020-12-08 05:37

    Alternatively, you can set the environment variable TF_CPP_MIN_LOG_LEVEL=2 to filter out info and warning messages. I found that on this github issue where they complain about the same output. To do so within python, you can use the solution from here:

    import os
    import tensorflow as tf
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
    

    You can even turn it on and off at will with this. I test for the maximum possible batch size before running my code, and I can disable warnings and errors while doing this.

提交回复
热议问题