I am trying to run one of the tutorials in TF SLIM, the one where you fine tune the flowers dataset using Inception-V3 (~104Mb). The GPU has about 2Gb of memory. When I have a batch size more than 8, I get an error because the GPU runs out of memory. In fact, it seems I get several messages, each looking like:
W tensorflow/core/common_runtime/bfc_allocator.cc:217] Ran out of memory trying to allocate 646.50MiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available.
and
W tensorflow/core/common_runtime/bfc_allocator.cc:274] **************************************x*************************************************************
W tensorflow/core/common_runtime/bfc_allocator.cc:275] Ran out of memory trying to allocate 168.8KiB. See logs for memory state.
Now, it could very well be that my GPU has not big enough RAM. However, 2GB seems more than enough to load a ~100Mb model. Also, with Caffe I could fine-tune an Alexnet (~400Mb) with no problem. Besides, I also tried to allow for GPU growth (from what I understand using the system's RAM) with
session_config = tf.ConfigProto(allow_soft_placement=True)
session_config.gpu_options.allow_growth = True
session_config.gpu_options.allocator_type = 'BFC'"
but it doesn't seem to help.
Do you know if
a) I am doing something wrong b) the GPU is just not big enough c) TF Slim consumes by construction too much memory
?
Thanks,