I've been trying to run the cyclegan-1 model (https://github.com/leehomyc/cyclegan-1) on the provided horse2zebra dataset in order to test my tensorflow-gpu install.
Everything seems to work fine at first, until the end of the first batch, when my system freezes up for a minute and I get this error:
2017-10-26 15:23:10.103303: E tensorflow/stream_executor/cuda/cuda_driver.cc:955] failed to alloc 8589934592 bytes on host: CUDA_ERROR_OUT_OF_MEMORY
2017-10-26 15:23:10.103321: W ./tensorflow/core/common_runtime/gpu/pool_allocator.h:195] could not allocate pinned host memory of size: 8589934592
2017-10-26 15:23:10.103592: E tensorflow/stream_executor/cuda/cuda_driver.cc:955] failed to alloc 7730940928 bytes on host: CUDA_ERROR_OUT_OF_MEMORY
2017-10-26 15:23:10.103599: W ./tensorflow/core/common_runtime/gpu/pool_allocator.h:195] could not allocate pinned host memory of size: 7730940928
./run_cyclegan_oct_26_2017: line 1: 15025 Killed python3 -m CycleGAN_TensorFlow.main --to_train=2 --log_dir=CycleGAN_TensorFlow/output/cyclegan/exp_01 --config_filename=CycleGAN_TensorFlow/configs/exp_01.json --checkpoint_dir=CycleGAN_TensorFlow/output/cyclegan/exp_01/20171026-005834
I searched similar problems and thought that this was caused by tensorflow trying to allocate RAM used for system processes.
However, after killing the x server and running from a tty, I got the same error at exactly the same place: right after it finishes processing the first batch.
It seems like tensorflow is trying to allocate around 8GB, though this is less than my system memory.
Is the problem that I need to limit Tensorflow's memory usage? I've read a lot about limiting its GPU memory usage but not RAM.
My setup:
- Memory 15.6 GiB
- Processor Intel core i5-4440 CPU @ 3.10Ghz x 4
- Graphics GeForce GTX 1060 6GB/PCIe/SSE2
- OS type 64-bit
- Plenty of disk space
- Using python3
Thanks!
Peter
CUDA_ERROR_OUT_OF_MEMORY
signals that your GPU is out of memory, not a reference to your RAM. Your graphics card has 6GB of memory and you're trying to allocate 8.5GB and 7.7.GB. – JoshVarty