matcaffe, passing gpu arrays

18 views
Skip to first unread message

Måns Larsson

unread,
Oct 23, 2016, 4:11:06 PM10/23/16
to Caffe Users
Hi everyone!
I was wondering if there is a way to pass gpuarrays from matlab to a caffe layer via matcaffe, without having to move them to cpu first.

The following:

caffe.set_mode_gpu();
net = caffe.Net(proto_path,'train');
x = single(rand(net.blobs('input').shape))

out = net.forward({x}); %this works
out = net.forward({gpuArray(x)}); %this doesnt

I have code where I have large gpuarrays that I want to pass through a caffe network. At the moment I need to move them to the cpu in matlab before being able to pass the to caffe. Does anyone know of a way of getting around this?

Thanks in advance!
\\Måns

Ahmed Ibrahim

unread,
Oct 24, 2016, 11:54:52 AM10/24/16
to Caffe Users
as far as i know , Matcaffe is just an interface to the C++ implementation. My guess is that this is not possible with matcaffe. May be you have to write your own wrapper to handle this .
Reply all
Reply to author
Forward
0 new messages