From 8218120663defac4a0415265fc7f31ea45b827e5 Mon Sep 17 00:00:00 2001 From: Emmanuel Benazera Date: Mon, 9 Mar 2015 17:24:45 +0100 Subject: [PATCH] updated Caffe template models for external testing --- templates/caffe/alexnet/alexnet.prototxt | 46 +++++++++++------ templates/caffe/cifar/cifar.prototxt | 26 ++++------ templates/caffe/googlenet/googlenet.prototxt | 50 ++++++++++--------- .../caffe/lregression/lregression.prototxt | 7 ++- templates/caffe/mlp/mlp.prototxt | 11 ++-- templates/caffe/nin/nin.prototxt | 27 ++++------ 6 files changed, 85 insertions(+), 82 deletions(-) diff --git a/templates/caffe/alexnet/alexnet.prototxt b/templates/caffe/alexnet/alexnet.prototxt index d7de31cf1..0429913f5 100644 --- a/templates/caffe/alexnet/alexnet.prototxt +++ b/templates/caffe/alexnet/alexnet.prototxt @@ -18,24 +18,39 @@ layer { backend: LMDB } } +#layer { +# name: "data" +# type: "Data" +# top: "data" +# top: "label" +# include { +# phase: TEST +# } +# transform_param { +# mirror: false +# crop_size: 227 +# mean_file: "mean.binaryproto" +# } +# data_param { +# source: "test.lmdb" +# batch_size: 50 +# backend: LMDB +# } +#} layer { - name: "data" - type: "Data" + name: "alexnet" + type: "MemoryData" top: "data" top: "label" + memory_data_param { + batch_size: 256 + channels: 3 + height: 227 + width: 227 + } include { phase: TEST } - transform_param { - mirror: false - crop_size: 227 - mean_file: "mean.binaryproto" - } - data_param { - source: "test.lmdb" - batch_size: 50 - backend: LMDB - } } layer { name: "conv1" @@ -366,11 +381,10 @@ layer { } } layer { - name: "accuracy" - type: "Accuracy" + name: "losst" + type: "Softmax" bottom: "fc8" - bottom: "label" - top: "accuracy" + top: "losst" include { phase: TEST } diff --git a/templates/caffe/cifar/cifar.prototxt b/templates/caffe/cifar/cifar.prototxt index ef5628412..af0385ebd 100644 --- a/templates/caffe/cifar/cifar.prototxt +++ b/templates/caffe/cifar/cifar.prototxt @@ -18,20 +18,18 @@ layer { } layer { name: "cifar" - type: "Data" + type: "MemoryData" top: "data" top: "label" + memory_data_param { + batch_size: 100 + channels: 3 + height: 32 + width: 32 + } include { phase: TEST } - transform_param { - mean_file: "mean.binaryproto" - } - data_param { - source: "test_lmdb" - batch_size: 100 - backend: LMDB - } } layer { name: "conv1" @@ -202,14 +200,10 @@ layer { } } layer { - name: "accuracy" - type: "Accuracy" + name: "losst" + type: "Softmax" bottom: "ip1" - bottom: "label" - top: "accuracy" - include { - phase: TEST - } + top: "losst" } layer { name: "loss" diff --git a/templates/caffe/googlenet/googlenet.prototxt b/templates/caffe/googlenet/googlenet.prototxt index 824f6f7dd..94d3770bd 100644 --- a/templates/caffe/googlenet/googlenet.prototxt +++ b/templates/caffe/googlenet/googlenet.prototxt @@ -22,25 +22,18 @@ layer { } } layer { - name: "data" - type: "Data" + name: "googlenet" + type: "MemoryData" top: "data" top: "label" - include { - phase: TEST - } - transform_param { - mirror: false - crop_size: 224 -# mean_value: 104 -# mean_value: 117 -# mean_value: 123 - mean_file: "mean.binaryproto" + memory_data_param { + batch_size: 32 + channels: 3 + height: 224 + width: 224 } - data_param { - source: "test.lmdb" - batch_size: 50 - backend: LMDB + include { + phase: TEST } } layer { @@ -2483,16 +2476,25 @@ layer { phase: TEST } } -layer { - name: "loss3/top-5" - type: "Accuracy" +#layer { +# name: "loss3/top-5" +# type: "Accuracy" +# bottom: "loss3/classifier" +# bottom: "label" +# top: "loss3/top-5" +# include { +# phase: TEST +# } +# accuracy_param { +# top_k: 5 +# } +#} +layer { + name: "probt" + type: "Softmax" bottom: "loss3/classifier" - bottom: "label" - top: "loss3/top-5" + top: "probt" include { phase: TEST } - accuracy_param { - top_k: 5 - } } diff --git a/templates/caffe/lregression/lregression.prototxt b/templates/caffe/lregression/lregression.prototxt index 27afa9549..6032fb508 100644 --- a/templates/caffe/lregression/lregression.prototxt +++ b/templates/caffe/lregression/lregression.prototxt @@ -42,11 +42,10 @@ layer { } } layer { - name: "accuracy" - type: "Accuracy" + name: "losst" + type: "Softmax" bottom: "ip1" - bottom: "label" - top: "accuracy" + top: "losst" include: { phase: TEST } } layer { diff --git a/templates/caffe/mlp/mlp.prototxt b/templates/caffe/mlp/mlp.prototxt index dbdde58ae..064881a16 100644 --- a/templates/caffe/mlp/mlp.prototxt +++ b/templates/caffe/mlp/mlp.prototxt @@ -73,12 +73,13 @@ layer { } } layer { - name: "accuracy" - type: "Accuracy" + name: "losst" + type: "Softmax" bottom: "ip2" - bottom: "label" - top: "accuracy" - include: { phase: TEST } + top: "losst" + include { + phase: TEST + } } layer { name: "loss" diff --git a/templates/caffe/nin/nin.prototxt b/templates/caffe/nin/nin.prototxt index 5904565c0..621c5931d 100644 --- a/templates/caffe/nin/nin.prototxt +++ b/templates/caffe/nin/nin.prototxt @@ -21,17 +21,13 @@ layer { layer { top: "data" top: "label" - name: "nin" - type: "Data" - data_param { - source: "train.lmdb" - backend: LMDB - batch_size: 89 - } - transform_param { - crop_size: 224 - mirror: false - mean_file: "mean.binaryproto" + name: "data" + type: "MemoryData" + memory_data_param { + batch_size: 64 + channels: 3 + height: 224 + width: 224 } include: { phase: TEST } } @@ -500,18 +496,15 @@ layer { } } layer { - name: "accuracy" - type: "Accuracy" bottom: "pool4" - bottom: "label" - top: "accuracy" - include: { phase: TEST } + name: "losst" + type: "Softmax" + top: "losst" } layer { bottom: "pool4" bottom: "label" name: "loss" type: "SoftmaxWithLoss" - include: { phase: TRAIN } top: "loss" }