From 9b38744f22aa3eaddf22f8a3b4cd0a877a050817 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Tue, 10 Feb 2015 13:26:11 -0800 Subject: [PATCH] switch to V2 proto definitions for pytest --- python/caffe/test/test_net.py | 11 ++++++----- python/caffe/test/test_python_layer.py | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/python/caffe/test/test_net.py b/python/caffe/test/test_net.py index f0e9dee..9381c72 100644 --- a/python/caffe/test/test_net.py +++ b/python/caffe/test/test_net.py @@ -11,21 +11,22 @@ def simple_net_file(num_output): f = tempfile.NamedTemporaryFile(delete=False) f.write("""name: 'testnet' force_backward: true - layers { type: DUMMY_DATA name: 'data' top: 'data' top: 'label' + layer { type: 'DummyData' name: 'data' top: 'data' top: 'label' dummy_data_param { num: 5 channels: 2 height: 3 width: 4 num: 5 channels: 1 height: 1 width: 1 data_filler { type: 'gaussian' std: 1 } data_filler { type: 'constant' } } } - layers { type: CONVOLUTION name: 'conv' bottom: 'data' top: 'conv' + layer { type: 'Convolution' name: 'conv' bottom: 'data' top: 'conv' convolution_param { num_output: 11 kernel_size: 2 pad: 3 weight_filler { type: 'gaussian' std: 1 } bias_filler { type: 'constant' value: 2 } } - weight_decay: 1 weight_decay: 0 } - layers { type: INNER_PRODUCT name: 'ip' bottom: 'conv' top: 'ip' + param { decay_mult: 1 } param { decay_mult: 0 } + } + layer { type: 'InnerProduct' name: 'ip' bottom: 'conv' top: 'ip' inner_product_param { num_output: """ + str(num_output) + """ weight_filler { type: 'gaussian' std: 2.5 } bias_filler { type: 'constant' value: -3 } } } - layers { type: SOFTMAX_LOSS name: 'loss' bottom: 'ip' bottom: 'label' + layer { type: 'SoftmaxWithLoss' name: 'loss' bottom: 'ip' bottom: 'label' top: 'loss' }""") f.close() return f.name diff --git a/python/caffe/test/test_python_layer.py b/python/caffe/test/test_python_layer.py index cfb1d83..03f5834 100644 --- a/python/caffe/test/test_python_layer.py +++ b/python/caffe/test/test_python_layer.py @@ -24,11 +24,11 @@ def python_net_file(): f = tempfile.NamedTemporaryFile(delete=False) f.write("""name: 'pythonnet' force_backward: true input: 'data' input_dim: 10 input_dim: 9 input_dim: 8 input_dim: 7 - layers { type: PYTHON name: 'one' bottom: 'data' top: 'one' + layer { type: 'Python' name: 'one' bottom: 'data' top: 'one' python_param { module: 'test_python_layer' layer: 'SimpleLayer' } } - layers { type: PYTHON name: 'two' bottom: 'one' top: 'two' + layer { type: 'Python' name: 'two' bottom: 'one' top: 'two' python_param { module: 'test_python_layer' layer: 'SimpleLayer' } } - layers { type: PYTHON name: 'three' bottom: 'two' top: 'three' + layer { type: 'Python' name: 'three' bottom: 'two' top: 'three' python_param { module: 'test_python_layer' layer: 'SimpleLayer' } }""") f.close() return f.name -- 2.7.4