Skip to content

Commit

Permalink
Merge pull request BVLC#2611 from dpaiton/test_net_bugfix
Browse files Browse the repository at this point in the history
[compatibility] fix syntax for old protobuf
  • Loading branch information
shelhamer committed Jun 23, 2015
2 parents ba88993 + 98fb438 commit af37efd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/caffe/test/test_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class NetTest : public MultiDeviceTest<TypeParam> {
const bool force_backward = false, const bool bias_term = false,
const Dtype blobs_lr_w1 = 1, const Dtype blobs_lr_b1 = 2,
const Dtype blobs_lr_w2 = 1, const Dtype blobs_lr_b2 = 2) {
string bias_str = bias_term ? "true ":"false ";
ostringstream proto;
proto << "name: 'UnsharedWeightsNetwork' ";
if (force_backward) {
Expand All @@ -314,7 +315,7 @@ class NetTest : public MultiDeviceTest<TypeParam> {
" type: 'InnerProduct' "
" inner_product_param { "
" num_output: 10 "
" bias_term: " << bias_term <<
" bias_term: " << bias_str <<
" weight_filler { "
" type: 'gaussian' "
" std: 10 "
Expand All @@ -340,7 +341,7 @@ class NetTest : public MultiDeviceTest<TypeParam> {
" type: 'InnerProduct' "
" inner_product_param { "
" num_output: 10 "
" bias_term: " << bias_term <<
" bias_term: " << bias_str <<
" weight_filler { "
" type: 'gaussian' "
" std: 10 "
Expand Down Expand Up @@ -699,9 +700,11 @@ class NetTest : public MultiDeviceTest<TypeParam> {
" bottom: 'innerproduct' "
" bottom: 'label_argmax' ";
if (test_skip_true)
proto += " propagate_down: [true, false] ";
proto += " propagate_down: true "
" propagate_down: false ";
else
proto += " propagate_down: [true, true] ";
proto += " propagate_down: true "
" propagate_down: true ";
proto +=
" top: 'cross_entropy_loss' "
" type: 'SigmoidCrossEntropyLoss' "
Expand Down

0 comments on commit af37efd

Please sign in to comment.