Tensorflow 1.3, ubuntu 16.04 Network size: 4M
Yet during graph construction it always give me: failed to alloc 34359738368 bytes on host: CUDA_ERROR_OUT_OF_MEMORY
Then I tried to capture all the log info from the screen, below is a snippet:
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorOutput { step_id: 9749 kernel_name: "input/ParseSingleExample/Squeeze_gtc_raw/_13" tensor { dtype: DT_FLOAT shape { dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "cuda_host_bfc" allocation_id: 19504 ptr: 1173065629696 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorOutput { step_id: 9750 kernel_name: "input/ParseSingleExample/ParseExample/ParseExample/_7" tensor { dtype: DT_FLOAT shape { dim { size: 1 } dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "GPU_0_bfc" allocation_id: 19619 ptr: 1117158602752 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorOutput { step_id: 9750 kernel_name: "input/ParseSingleExample/Squeeze_img_raw" tensor { dtype: DT_FLOAT shape { dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "GPU_0_bfc" allocation_id: 19619 ptr: 1117158602752 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorAllocation { step_id: -6 kernel_name: "Unknown" tensor { dtype: DT_FLOAT shape { dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1835008 allocator_name: "cuda_host_bfc" allocation_id: 19505 has_single_reference: true ptr: 1173067399168 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorOutput { step_id: 9750 kernel_name: "input/ParseSingleExample/ParseExample/ParseExample/_9" tensor { dtype: DT_FLOAT shape { dim { size: 1 } dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "GPU_0_bfc" allocation_id: 19620 ptr: 1117162141696 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorOutput { step_id: 9750 kernel_name: "input/ParseSingleExample/Squeeze_gtc_raw" tensor { dtype: DT_FLOAT shape { dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "GPU_0_bfc" allocation_id: 19620 ptr: 1117162141696 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorAllocation { step_id: -6 kernel_name: "Unknown" tensor { dtype: DT_FLOAT shape { dim { size: 1 } dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "GPU_0_bfc" allocation_id: 19621 has_single_reference: true ptr: 1117158602752 } } }
I tensorflow/core/framework/log_memory.cc:35] LOG_MEMORY MemoryLogTensorAllocation { step_id: -6 kernel_name: "Unknown" tensor { dtype: DT_FLOAT shape { dim { size: 1 } dim { size: 256 } dim { size: 576 } dim { size: 3 } } allocation_description { requested_bytes: 1769472 allocated_bytes: 1769472 allocator_name: "GPU_0_bfc" allocation_id: 19622 has_single_reference: true ptr: 1117160372224 } } }
YOU CAN SEE that TF keeps assigning memory to input image(size: 256x576x3, batch size 1)
WHEN I check how many lines containing this assignment I got
grep -c 'allocated_bytes: 1769472' logging.txt 97022
AMAZING!
MY QUESTION is: why TF keeps assigning memory to input images? which probably results in the memory leak?
Thanks!