入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

用nohup重定向python输出到文件不成功的解决办法

创建时间:2016-05-15 投稿人: 浏览次数:1638

原因是:

It looks like you need to flush stdout periodically (e.g. sys.stdout.flush()). In my testing Python doesn"t automatically do this even with print until the program exits.
You can run Python with the -u flag to avoid output buffering

所以,

解决办法之一:加-u

nohup python -u Bilstm-My-Exp-Char.py --training 1 --char_base 1 --window 5 --rnn_active relu --data_root ../../wangzhen/bilstm/ --load_embed 1 --model_pkl mdl5-15-14-30 > 5.txt 2>&1 &

解决办法之二: sys.stdout.flush()



nohup sucks!

声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
  • 上一篇:没有了
  • 下一篇:没有了
未上传头像