switch to V2 proto definitions for pytest
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Tue, 10 Feb 2015 21:26:11 +0000 (13:26 -0800)
committerJonathan L Long <jonlong@cs.berkeley.edu>
Tue, 17 Feb 2015 06:47:30 +0000 (22:47 -0800)
python/caffe/test/test_net.py
python/caffe/test/test_python_layer.py

index f0e9dee..9381c72 100644 (file)
@@ -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
index cfb1d83..03f5834 100644 (file)
@@ -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