diff --git a/src/lstm/tfnetwork.cpp b/src/lstm/tfnetwork.cpp index fe456b43..b3898455 100644 --- a/src/lstm/tfnetwork.cpp +++ b/src/lstm/tfnetwork.cpp @@ -32,7 +32,7 @@ namespace tesseract { TFNetwork::TFNetwork(const STRING& name) : Network(NT_TENSORFLOW, name, 0, 0) {} -int TFNetwork::InitFromProtoStr(const string& proto_str) { +int TFNetwork::InitFromProtoStr(const std::string& proto_str) { if (!model_proto_.ParseFromString(proto_str)) return 0; return InitFromProto(); } @@ -41,7 +41,7 @@ int TFNetwork::InitFromProtoStr(const string& proto_str) { // Should be overridden by subclasses, but called by their Serialize. bool TFNetwork::Serialize(TFile* fp) const { if (!Network::Serialize(fp)) return false; - string proto_str; + std::string proto_str; model_proto_.SerializeToString(&proto_str); GenericVector data; data.resize_no_init(proto_str.size()); @@ -66,7 +66,7 @@ bool TFNetwork::DeSerialize(TFile* fp) { void TFNetwork::Forward(bool debug, const NetworkIO& input, const TransposedArray* input_transpose, NetworkScratch* scratch, NetworkIO* output) { - std::vector> tf_inputs; + std::vector> tf_inputs; int depth = input_shape_.depth(); ASSERT_HOST(depth == input.NumFeatures()); // TODO(rays) Allow batching. For now batch_size = 1. @@ -101,7 +101,7 @@ void TFNetwork::Forward(bool debug, const NetworkIO& input, *eigen_htensor.data() = stride_map.Size(FD_HEIGHT); tf_inputs.emplace_back(model_proto_.image_heights(), height_tensor); } - std::vector target_layers = {model_proto_.output_layer()}; + std::vector target_layers = {model_proto_.output_layer()}; std::vector outputs; Status s = session_->Run(tf_inputs, target_layers, {}, &outputs); if (!s.ok()) tprintf("session->Run failed:%s\n", s.error_message().c_str()); diff --git a/src/lstm/tfnetwork.h b/src/lstm/tfnetwork.h index 1bccd233..2dbb4ba2 100644 --- a/src/lstm/tfnetwork.h +++ b/src/lstm/tfnetwork.h @@ -50,7 +50,7 @@ class TFNetwork : public Network { // Deserializes *this from a serialized TFNetwork proto. Returns 0 if failed, // otherwise the global step of the serialized graph. - int InitFromProtoStr(const string& proto_str); + int InitFromProtoStr(const std::string& proto_str); // The number of classes in this network should be equal to those in the // recoder_ in LSTMRecognizer. int num_classes() const { return output_shape_.depth(); } @@ -72,7 +72,7 @@ class TFNetwork : public Network { int InitFromProto(); // The original network definition for reference. - string spec_; + std::string spec_; // Input tensor parameters. StaticShape input_shape_; // Output tensor parameters.