Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Caffe cpu & gpu mode simultaneously

Tags:

python

caffe

Is it possible to run Caffe in both CPU and GPU mode? I have several Caffe models, but my GPU resources are limited, so that I can't put all models into GPU memory. I want to use e.g. 3 models with GPU mode and 2 models with CPU mode, but set_mode_cpu() and set_mode_gpu() commands just switch the mode for the whole library.

like image 259
user1263702 Avatar asked Feb 11 '26 09:02

user1263702


1 Answers

In my opinion, you can write multiple python scripts one for each task. In each script you can choose whether use CPU or GPU (and GPU device). Then you can run these multiple scripts at the same time. But run multiple tasks at one GPU card with slow down the speed severely in my experience. Good luck!

like image 66
kli_nlpr Avatar answered Feb 13 '26 00:02

kli_nlpr