Hussain
Hussain

Reputation: 41

"tensorflow/core/platform/posix/subprocess.cc:208] Start cannot fork() child process: Cannot allocate memory"

I have got this error while running frcnn resnet 50 on my dataset of black and white images of Height:540 pixels and Width:800 pixels

tensorflow/core/platform/posix/subprocess.cc:208] Start cannot fork() child process: Cannot allocate memory 

I am currently working on K80 GPU (Google Cloud) ubuntu 18.04

Any help regarding this error would be appreciated.

Upvotes: 4

Views: 8425

Answers (2)

Konstantin Vdovkin
Konstantin Vdovkin

Reputation: 163

Enabling GPU memory growth helped for me

gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
    tf.config.experimental.set_memory_growth(gpu, True)

https://www.tensorflow.org/guide/gpu#limiting_gpu_memory_growth

Upvotes: 1

Max F.
Max F.

Reputation: 328

So, for me this got resolved when updating the Nvidia-Driver and switching to another CUDA and cudnn version. This is the combo that works for me (on a GTX1080Ti on Ubuntu 18.04):

  • Python 3.7
  • Nvidia-Driver 440.48.02
  • CUDA 10.0.130
  • cudnn 7.6.5.32
  • Tensorflow-gpu 2.0

The same setup also works on a RTX2070 for me, but only if I add these code lines before my training loop:

from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)

Upvotes: 2

Related Questions