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