Skip to content

Commit b21699e

Browse files
committed
tf log level
1 parent d2d233b commit b21699e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

demo/deep_model/predict.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22

3+
export TF_CPP_MIN_LOG_LEVEL=3
34
../../bin/deep_model.bin \
45
"9,6,116,152,179" \
56
"./data/dict.data" \

demo/simple_model/predict.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/usr/bin/env bash
22

3+
export TF_CPP_MIN_LOG_LEVEL=3
34
../../bin/simple_model.bin "./model/graph.pb"

src/simple_model.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int main(int argc, char* argv[]) {
1616
Session* session;
1717
Status status = NewSession(SessionOptions(), &session);
1818
if (!status.ok()) {
19-
std::cout << status.ToString() << std::endl;
19+
std::cerr << status.ToString() << std::endl;
2020
return 1;
2121
} else {
2222
std::cout << "Session created successfully" << std::endl;
@@ -27,7 +27,7 @@ int main(int argc, char* argv[]) {
2727
std::string graph_path = argv[1];
2828
status = ReadBinaryProto(Env::Default(), graph_path, &graph_def);
2929
if (!status.ok()) {
30-
std::cout << status.ToString() << std::endl;
30+
std::cerr << status.ToString() << std::endl;
3131
return 1;
3232
} else {
3333
std::cout << "Load graph protobuf successfully" << std::endl;
@@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
3636
// Add the graph to the session
3737
status = session->Create(graph_def);
3838
if (!status.ok()) {
39-
std::cout << status.ToString() << std::endl;
39+
std::cerr << status.ToString() << std::endl;
4040
return 1;
4141
} else {
4242
std::cout << "Add graph to session successfully" << std::endl;
@@ -63,7 +63,7 @@ int main(int argc, char* argv[]) {
6363
// Run the session, evaluating our "c" operation from the graph
6464
status = session->Run(inputs, {"c"}, {}, &outputs);
6565
if (!status.ok()) {
66-
std::cout << status.ToString() << std::endl;
66+
std::cerr << status.ToString() << std::endl;
6767
return 1;
6868
} else {
6969
std::cout << "Run session successfully" << std::endl;

0 commit comments

Comments
 (0)