def set_caffe_mode(gpu): ''' Set whether caffe runs in gpu or not, input is boolean ''' if gpu: caffe.set_mode_gpu() else: caffe.set_mode_cpu()