caffe 指定GPU

来源:互联网 发布:淘宝二手手机靠谱么 编辑:程序博客网 时间:2024/06/07 04:51

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 暂时不支持.


0 0
原创粉丝点击