index 013bd67ae51bb81edf811e78d30ec86514d4b2df..cd16ed659091ee5fbb75a95b94fc4045f97b63da 100644 (file)
// Copyright 2013 Yangqing Jia
-#include <cstring>
#include <cuda_runtime.h>
+#include <fcntl.h>
#include <google/protobuf/text_format.h>
+#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <gtest/gtest.h>
+#include <cstring>
+
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/net.hpp"
#include "caffe/filler.hpp"
#include "caffe/proto/caffe.pb.h"
+#include "caffe/util/io.hpp"
#include "caffe/test/lenet.hpp"
#include "caffe/test/test_caffe_main.hpp"
typedef ::testing::Types<float, double> Dtypes;
TYPED_TEST_CASE(NetProtoTest, Dtypes);
+TYPED_TEST(NetProtoTest, TestLoadFromText) {
+ NetParameter net_param;
+ ReadProtoFromTextFile("caffe/test/data/lenet.prototxt", &net_param);
+}
+
TYPED_TEST(NetProtoTest, TestSetup) {
NetParameter net_param;
string lenet_string(kLENET);
lenet_string, &net_param));
// check if things are right
EXPECT_EQ(net_param.layers_size(), 9);
- EXPECT_EQ(net_param.bottom_size(), 2);
- EXPECT_EQ(net_param.top_size(), 0);
+ EXPECT_EQ(net_param.input_size(), 2);
// Now, initialize a network using the parameter
shared_ptr<Blob<TypeParam> > data(new Blob<TypeParam>(10, 1, 28, 28));
// Run the network without training.
vector<Blob<TypeParam>*> top_vec;
LOG(ERROR) << "Performing Forward";
- caffe_net.Forward(bottom_vec, &top_vec);
+ caffe_net.Forward(bottom_vec);
LOG(ERROR) << "Performing Backward";
LOG(ERROR) << caffe_net.Backward();
-
}
} // namespace caffe