Skip to content

Commit 2cc3844

Browse files
committed
[examples] switch examples + models to Input layers
1 parent 0d9a78f commit 2cc3844

File tree

13 files changed

+83
-89
lines changed

13 files changed

+83
-89
lines changed

examples/cifar10/cifar10_full.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: "CIFAR10_full_deploy"
22
# N.B. input image must be in CIFAR-10 format
33
# as described at http://www.cs.toronto.edu/~kriz/cifar.html
4-
input: "data"
5-
input_shape {
6-
dim: 1
7-
dim: 3
8-
dim: 32
9-
dim: 32
4+
layer {
5+
name: "data"
6+
type: "Input"
7+
top: "data"
8+
input_param { shape: { dim: 1 dim: 3 dim: 32 dim: 32 } }
109
}
1110
layer {
1211
name: "conv1"

examples/cifar10/cifar10_quick.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "CIFAR10_quick_test"
2-
input: "data"
3-
input_shape {
4-
dim: 1
5-
dim: 3
6-
dim: 32
7-
dim: 32
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 1 dim: 3 dim: 32 dim: 32 } }
87
}
98
layer {
109
name: "conv1"

examples/cpp_classification/classification.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ std::vector<float> Classifier::Predict(const cv::Mat& img) {
159159

160160
Preprocess(img, &input_channels);
161161

162-
net_->ForwardPrefilled();
162+
net_->Forward();
163163

164164
/* Copy the output layer to a std::vector */
165165
Blob<float>* output_layer = net_->output_blobs()[0];

examples/mnist/lenet.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "LeNet"
2-
input: "data"
3-
input_shape {
4-
dim: 64
5-
dim: 1
6-
dim: 28
7-
dim: 28
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 64 dim: 1 dim: 28 dim: 28 } }
87
}
98
layer {
109
name: "conv1"

examples/net_surgery.ipynb

+21-22
Original file line numberDiff line numberDiff line change
@@ -5494,48 +5494,47 @@
54945494
"name": "stdout",
54955495
"output_type": "stream",
54965496
"text": [
5497-
"1,2c1\r\n",
5497+
"1,2c1,2\r\n",
54985498
"< # Fully convolutional network version of CaffeNet.\r\n",
54995499
"< name: \"CaffeNetConv\"\r\n",
55005500
"---\r\n",
55015501
"> name: \"CaffeNet\"\r\n",
5502-
"4c3\r\n",
5503-
"< input_dim: 1\r\n",
5502+
"> input: \"data\"\r\n",
5503+
"7,11c7\r\n",
5504+
"< input_param {\r\n",
5505+
"< # initial shape for a fully convolutional network:\r\n",
5506+
"< # the shape can be set for each input by reshape.\r\n",
5507+
"< shape: { dim: 1 dim: 3 dim: 451 dim: 451 }\r\n",
5508+
"< }\r\n",
55045509
"---\r\n",
5505-
"> input_dim: 10\r\n",
5506-
"6,7c5,6\r\n",
5507-
"< input_dim: 451\r\n",
5508-
"< input_dim: 451\r\n",
5509-
"---\r\n",
5510-
"> input_dim: 227\r\n",
5511-
"> input_dim: 227\r\n",
5512-
"152,153c151,152\r\n",
5510+
"> input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }\r\n",
5511+
"157,158c153,154\r\n",
55135512
"< name: \"fc6-conv\"\r\n",
55145513
"< type: \"Convolution\"\r\n",
55155514
"---\r\n",
55165515
"> name: \"fc6\"\r\n",
55175516
"> type: \"InnerProduct\"\r\n",
5518-
"155,156c154,155\r\n",
5517+
"160,161c156,157\r\n",
55195518
"< top: \"fc6-conv\"\r\n",
55205519
"< convolution_param {\r\n",
55215520
"---\r\n",
55225521
"> top: \"fc6\"\r\n",
55235522
"> inner_product_param {\r\n",
5524-
"158d156\r\n",
5523+
"163d158\r\n",
55255524
"< kernel_size: 6\r\n",
5526-
"164,165c162,163\r\n",
5525+
"169,170c164,165\r\n",
55275526
"< bottom: \"fc6-conv\"\r\n",
55285527
"< top: \"fc6-conv\"\r\n",
55295528
"---\r\n",
55305529
"> bottom: \"fc6\"\r\n",
55315530
"> top: \"fc6\"\r\n",
5532-
"170,171c168,169\r\n",
5531+
"175,176c170,171\r\n",
55335532
"< bottom: \"fc6-conv\"\r\n",
55345533
"< top: \"fc6-conv\"\r\n",
55355534
"---\r\n",
55365535
"> bottom: \"fc6\"\r\n",
55375536
"> top: \"fc6\"\r\n",
5538-
"177,181c175,179\r\n",
5537+
"182,186c177,181\r\n",
55395538
"< name: \"fc7-conv\"\r\n",
55405539
"< type: \"Convolution\"\r\n",
55415540
"< bottom: \"fc6-conv\"\r\n",
@@ -5547,21 +5546,21 @@
55475546
"> bottom: \"fc6\"\r\n",
55485547
"> top: \"fc7\"\r\n",
55495548
"> inner_product_param {\r\n",
5550-
"183d180\r\n",
5549+
"188d182\r\n",
55515550
"< kernel_size: 1\r\n",
5552-
"189,190c186,187\r\n",
5551+
"194,195c188,189\r\n",
55535552
"< bottom: \"fc7-conv\"\r\n",
55545553
"< top: \"fc7-conv\"\r\n",
55555554
"---\r\n",
55565555
"> bottom: \"fc7\"\r\n",
55575556
"> top: \"fc7\"\r\n",
5558-
"195,196c192,193\r\n",
5557+
"200,201c194,195\r\n",
55595558
"< bottom: \"fc7-conv\"\r\n",
55605559
"< top: \"fc7-conv\"\r\n",
55615560
"---\r\n",
55625561
"> bottom: \"fc7\"\r\n",
55635562
"> top: \"fc7\"\r\n",
5564-
"202,206c199,203\r\n",
5563+
"207,211c201,205\r\n",
55655564
"< name: \"fc8-conv\"\r\n",
55665565
"< type: \"Convolution\"\r\n",
55675566
"< bottom: \"fc7-conv\"\r\n",
@@ -5573,9 +5572,9 @@
55735572
"> bottom: \"fc7\"\r\n",
55745573
"> top: \"fc8\"\r\n",
55755574
"> inner_product_param {\r\n",
5576-
"208d204\r\n",
5575+
"213d206\r\n",
55775576
"< kernel_size: 1\r\n",
5578-
"214c210\r\n",
5577+
"219c212\r\n",
55795578
"< bottom: \"fc8-conv\"\r\n",
55805579
"---\r\n",
55815580
"> bottom: \"fc8\"\r\n"

examples/net_surgery/bvlc_caffenet_full_conv.prototxt

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Fully convolutional network version of CaffeNet.
22
name: "CaffeNetConv"
3-
input: "data"
4-
input_shape {
5-
dim: 1
6-
dim: 3
7-
dim: 451
8-
dim: 451
3+
layer {
4+
name: "data"
5+
type: "Input"
6+
top: "data"
7+
input_param {
8+
# initial shape for a fully convolutional network:
9+
# the shape can be set for each input by reshape.
10+
shape: { dim: 1 dim: 3 dim: 451 dim: 451 }
11+
}
912
}
1013
layer {
1114
name: "conv1"

examples/net_surgery/conv.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Simple single-layer network to showcase editing model parameters.
22
name: "convolution"
3-
input: "data"
4-
input_shape {
5-
dim: 1
6-
dim: 1
7-
dim: 100
8-
dim: 100
3+
layer {
4+
name: "data"
5+
type: "Input"
6+
top: "data"
7+
input_param { shape: { dim: 1 dim: 1 dim: 100 dim: 100 } }
98
}
109
layer {
1110
name: "conv"

examples/siamese/mnist_siamese.prototxt

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: "mnist_siamese"
2-
input: "data"
3-
input_shape {
4-
dim: 10000
5-
dim: 1
6-
dim: 28
7-
dim: 28
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param {
7+
shape: { dim: 10000 dim: 1 dim: 28 dim: 28 }
8+
}
89
}
910
layer {
1011
name: "conv1"

models/bvlc_alexnet/deploy.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "AlexNet"
2-
input: "data"
3-
input_shape {
4-
dim: 10
5-
dim: 3
6-
dim: 227
7-
dim: 227
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
87
}
98
layer {
109
name: "conv1"

models/bvlc_googlenet/deploy.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "GoogleNet"
2-
input: "data"
3-
input_shape {
4-
dim: 10
5-
dim: 3
6-
dim: 224
7-
dim: 224
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 10 dim: 3 dim: 224 dim: 224 } }
87
}
98
layer {
109
name: "conv1/7x7_s2"

models/bvlc_reference_caffenet/deploy.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "CaffeNet"
2-
input: "data"
3-
input_shape {
4-
dim: 10
5-
dim: 3
6-
dim: 227
7-
dim: 227
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
87
}
98
layer {
109
name: "conv1"

models/bvlc_reference_rcnn_ilsvrc13/deploy.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "R-CNN-ilsvrc13"
2-
input: "data"
3-
input_shape {
4-
dim: 10
5-
dim: 3
6-
dim: 227
7-
dim: 227
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
87
}
98
layer {
109
name: "conv1"

models/finetune_flickr_style/deploy.prototxt

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "FlickrStyleCaffeNet"
2-
input: "data"
3-
input_shape {
4-
dim: 10
5-
dim: 3
6-
dim: 227
7-
dim: 227
2+
layer {
3+
name: "data"
4+
type: "Input"
5+
top: "data"
6+
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
87
}
98
layer {
109
name: "conv1"

0 commit comments

Comments
 (0)