When we train our deep learning model in linux ternimal, we may see many python print messages.
These messages include loss value, train steps, time or accuracy etc. These message are very helpful for us to evaluate our model.
However, Messages in linux ternimal are not saved into a file, if you close terminal, you will never see them.
How to save python print message into a file?
Here we can use script -f log.txt command.
Then all messages in terminal will be save into log.txt file
Of course, if you want to stop save messages into log.txt, you have to ways.
1. Open a new terminal
2. Press Ctrl+D to close script command
Here is my effect using script.