szagoruyko / torch-caffe-binding

Use Caffe in Torch7
BSD 2-Clause "Simplified" License
63 stars 19 forks source link

how do i use my own caffe, but it behaves as loadcaffe? #9

Open zimenglan-sysu-512 opened 7 years ago

zimenglan-sysu-512 commented 7 years ago

hi @szagoruyko thanks for your great work. but, how do i use my own caffe (just follow your instruction to install it: CAFFE_DIR=/*path-to-caffe-root*/ luarocks install caffe), to make it behave as loadcaffe so that i can use https://github.com/ramprs/grad-cam to visualize my trained caffemodel?

e.g.

for i = 1, #cnn.modules do
      model1:add(cnn:get(i))
      layer_id = i
      if cnn:get(i).name == layer_name then
           break
      end
end

how to get modules?

thanks.

szagoruyko commented 7 years ago

No, you need to use loadcaffe and add missing modules to lua torch.

HAHA-DL commented 7 years ago

Hi @zimenglan-sysu-512 , can I ask how you fix the loading model problem using GradCAM? I meet a problem these days when using GradCAM to visualize a self-trained caffemodel. The outputs dimension is 4096 not my defined label number (10 in my model). Did you meet this problem?

HAHA-DL commented 7 years ago

Hi @szagoruyko , you said to add missing modules to lua torch. But how can I assign the values of the weights to the added modules?