bert icon indicating copy to clipboard operation
bert copied to clipboard

How to redirect logging to a file?

Open FynnYoung opened this issue 8 years ago • 4 comments

I want to redirect tensorflow logging to a file, where tensorflow logging means the information that is outputted to screen: INFO:tensorflow:examples/sec: ...... INFO:tensorflow:global_step/sec: ......

I have tried command like: python run_classifier.py ...... > log.txt but it does work. Does anyone know how to do that?

FynnYoung avatar Nov 13 '18 01:11 FynnYoung

It gets printed to STDERR by default so >& log.txt should work.

jacobdevlin-google avatar Nov 13 '18 01:11 jacobdevlin-google

It gets printed to STDERR by default so >& log.txt should work.

It works, thanks! I guess "command >log.txt 2>&1" does the same thing.

FynnYoung avatar Nov 13 '18 02:11 FynnYoung

@jacobdevlin-google How to enable this benchmark logging message when --do_predict=True?

ghostplant avatar May 22 '19 09:05 ghostplant

My way: cmd 2>&1 | tee output.txt

zjplab avatar Oct 30 '19 21:10 zjplab