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

前端 未结 6 1206
盖世英雄少女心
盖世英雄少女心 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条回答
  •  猫巷女王i
    2020-12-08 05:43

    I was having the same problem while running Tensorflow container with Docker and Jupyter notebook. I was able to fix this problem by increasing the container memory.

    On Mac OS, you can easily do this from:

           Docker Icon > Preferences >  Advanced > Memory
    

    Drag the scrollbar to maximum (e.g. 4GB). Apply and it will restart the Docker engine.

    Now run your tensor flow container again.

    It was handy to use the docker stats command in a separate terminal It shows the container memory usage in realtime, and you can see how much memory consumption is growing:

    CONTAINER ID   NAME   CPU %   MEM USAGE / LIMIT     MEM %    NET I/O             BLOCK I/O           PIDS
    3170c0b402cc   mytf   0.04%   588.6MiB / 3.855GiB   14.91%   13.1MB / 3.06MB     214MB / 3.13MB      21
    

提交回复
热议问题