@@ -16,7 +16,6 @@ using caffe::Blob;
16
16
using caffe::Caffe;
17
17
using caffe::Datum;
18
18
using caffe::Net;
19
- using boost::shared_ptr;
20
19
using std::string;
21
20
namespace db = caffe::db;
22
21
@@ -51,7 +50,7 @@ int feature_extraction_pipeline(int argc, char** argv) {
51
50
arg_pos = num_required_args;
52
51
if (argc > arg_pos && strcmp (argv[arg_pos], " GPU" ) == 0 ) {
53
52
LOG (ERROR)<< " Using GPU" ;
54
- uint device_id = 0 ;
53
+ int device_id = 0 ;
55
54
if (argc > arg_pos + 1 ) {
56
55
device_id = atoi (argv[arg_pos + 1 ]);
57
56
CHECK_GE (device_id, 0 );
@@ -95,7 +94,7 @@ int feature_extraction_pipeline(int argc, char** argv) {
95
94
}
96
95
*/
97
96
std::string feature_extraction_proto (argv[++arg_pos]);
98
- shared_ptr<Net<Dtype> > feature_extraction_net (
97
+ boost:: shared_ptr<Net<Dtype> > feature_extraction_net (
99
98
new Net<Dtype>(feature_extraction_proto, caffe::TEST));
100
99
feature_extraction_net->CopyTrainedLayersFrom (pretrained_binary_proto);
101
100
@@ -119,15 +118,15 @@ int feature_extraction_pipeline(int argc, char** argv) {
119
118
120
119
int num_mini_batches = atoi (argv[++arg_pos]);
121
120
122
- std::vector<shared_ptr<db::DB> > feature_dbs;
123
- std::vector<shared_ptr<db::Transaction> > txns;
121
+ std::vector<boost:: shared_ptr<db::DB> > feature_dbs;
122
+ std::vector<boost:: shared_ptr<db::Transaction> > txns;
124
123
const char * db_type = argv[++arg_pos];
125
124
for (size_t i = 0 ; i < num_features; ++i) {
126
125
LOG (INFO)<< " Opening dataset " << dataset_names[i];
127
- shared_ptr<db::DB> db (db::GetDB (db_type));
126
+ boost:: shared_ptr<db::DB> db (db::GetDB (db_type));
128
127
db->Open (dataset_names.at (i), db::NEW);
129
128
feature_dbs.push_back (db);
130
- shared_ptr<db::Transaction> txn (db->NewTransaction ());
129
+ boost:: shared_ptr<db::Transaction> txn (db->NewTransaction ());
131
130
txns.push_back (txn);
132
131
}
133
132
@@ -139,8 +138,8 @@ int feature_extraction_pipeline(int argc, char** argv) {
139
138
for (int batch_index = 0 ; batch_index < num_mini_batches; ++batch_index) {
140
139
feature_extraction_net->Forward (input_vec);
141
140
for (int i = 0 ; i < num_features; ++i) {
142
- const shared_ptr<Blob<Dtype> > feature_blob = feature_extraction_net
143
- ->blob_by_name (blob_names[i]);
141
+ const boost:: shared_ptr<Blob<Dtype> > feature_blob =
142
+ feature_extraction_net ->blob_by_name (blob_names[i]);
144
143
int batch_size = feature_blob->num ();
145
144
int dim_features = feature_blob->count () / batch_size;
146
145
const Dtype* feature_blob_data;
0 commit comments