In the previous caffe version, I use the net.set_mode_gpu in python. But, the new caffe codes remove the set_mode_gpu function from net, and instead use the caffe.set_mode_gpu.
However, it is noteworthy that the Classify function should be given a ‘gpu’ parameter, as following:
net = caffe.Classifier(‘deploy.prototxt’, ‘caffemodel’, gpu=True);
If you do not set the gpu with True, the default parameter is ‘False’, and the codes will still run on CPU mode.