yjxiong / caffe

A fork of Caffe with OpenMPI-based Multi-GPU (mainly data parallel) support for action recognition and more. More documentation please see the original readme.
http://caffe.berkeleyvision.org/
Other
551 stars 154 forks source link

memory for vgg16 is not reduced #206

Closed twmht closed 6 years ago

twmht commented 6 years ago

Hi,

I try vgg16 network (https://github.com/ruimashita/caffe-train/blob/master/vgg.deploy.prototxt) with optimized memory.

But the used memory is not reduced.

Before turning on the memory optimization, the used memory is 756MiB.

After turning on the memory optimization, the used memory is still 756MiB.

Here is the reproduction step

build/tools/caffe time --model ~/vgg.deploy.prototxt --gpu 0 --itera
tions 1000

And the log is

I0425 23:31:32.984594 18666 net.cpp:1275] raw memory 84045680 opt memory 31527920
yjxiong commented 6 years ago

Would you please tell me how did you enable memory optimization? And to verify whether it works I recommend you using caffe train or caffe test instead of the caffe time command.

twmht commented 6 years ago

Here is the way I used to enable memory optimization.

Add mem_param in the beginning of the prototxt.

mem_param {
  optimize_train: true
  optimize_test: true
  # # exclude_blob: "fc1"
  # # exclude_blob: "fc2"
}