caffe调用已生成的模型和测试

来源:互联网 发布:linux http server 编辑:程序博客网 时间:2024/06/13 10:10

在配置教程里有训练好的模型,然后使用caffe去调用这个模型。

先看一下build/tools/caffe.bin文件里面有哪些参数:

1、先是test表明是要评价一个已经训练好的模型。

2、然后指定模型prototxt文件,这是一个文本文件,详细描述了网络结构和数据集信息。从mnist下面的train_lenet.sh指定的solver对应于examples/mnist/lenet_solver.prototxt,而lenet_solver.prototxt指定的模型为examples/mnist/lenet_train_test.prototxt。

3、然后在指定模型的具体的权重。刚好为examples/mnist/lenet_iter_5000.caffemodel

下面调用已经训练好的模型,测试。

同上,是下面是一个我自己的三张图片的测试里面有两张猫的,调用bvlc_reference_caffenet.caffemodel模型

./build/tools/caffe.bin test -weights=models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel -model=examples/_temp/imagenet_val.prototxt -gpu=0

1、先是test表明是要评价一个已经训练好的模型。

2、然后imagenet_val.prototxt指定模型prototxt文件,这是一个文本文件,详细描述了网络结构和数据集信息。

3、然后在指定模型的具体的权重为models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel

测得准确率只有75%

0 0