轉載請注明出處:
http://www.cnblogs.com/darkknightzh/p/5884892.html
參考網址:
http://caffe.berkeleyvision.org/tutorial/interfaces.html
由於在ubuntu中使用caffe的程序時,都使用.sh文件,該文件中常見的命令為:
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt
當電腦中有多個GPU時,默認使用GPU0。如果想使用其他的GPU,可以將該文件內容修改如下:
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu 2
注意,caffe中默認編號從0開始,因而--GPU 2的意思是使用第3個GPU。
如果要使用多個GPU,可以使用如下命令:
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu 0,1,2,3
則使用0,1,2,3這4個GPU。
如果要使用所有的GPU,可使用如下命令:
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu all
注意,使用的GPU越多,開始初始化時時間越久。當然,訓練速度越快。
