CPU 模式:
Makefile.config
CPU_ONLY:=1
make clean
make -j4
./build/tools/caffe.bin time -model examples/mnist/lenet_train_test.prototxt
Testing for 50 iterations.
3350ms
GPU 模式:
Makefile.config
#CPU_ONLY:=1
make clean
make -j4
./build/tools/caffe.bin time -model examples/mnist/lenet_train_test.prototxt -gpu 0
Testing for 50 iterations.
I0105 10:14:01.645095 6806 caffe.cpp:412] Average Forward pass: 4.5064 ms.
I0105 10:14:01.645103 6806 caffe.cpp:414] Average Backward pass: 6.51756 ms.
I0105 10:14:01.645110 6806 caffe.cpp:416] Average Forward-Backward: 11.0997 ms.
I0105 10:14:01.645122 6806 caffe.cpp:418] Total Time: 554.985 ms.
cuDNN 模式:
Makefile.config
USE_CUDNN:=1
make clean
make -j
./build/tools/caffe.bin time -model examples/mnist/lenet_train_test.prototxt -gpu 0
Testing for 50 iterations.
I0105 10:20:37.588495 14720 caffe.cpp:412] Average Forward pass: 0.699844 ms.
I0105 10:20:37.588518 14720 caffe.cpp:414] Average Backward pass: 1.03538 ms.
I0105 10:20:37.588541 14720 caffe.cpp:416] Average Forward-Backward: 1.79493 ms.
I0105 10:20:37.588564 14720 caffe.cpp:418] Total Time: 89.7464 ms.