caffe 指定GPU


caffe默認使用編號為0的gpu, 若它的內存不夠或正忙, 即使有其余gpu空閑, caffe也不會使用. 要用哪個gpu, 就要明確指定哪個. 不指定則使用默認.

命令行

./build/tools/caffe train --solver=examples/testXXX/solver.prototxt # 使用默認的gpu0
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu 2
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu 0,1,2
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu all

代碼指定

from https://github.com/BVLC/caffe/blob/master/docs/multigpu.md

Currently Multi-GPU is only supported via the C/C++ paths and only for training.

pycaffe 暫時不支持.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM