微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AI Platform 上所有日志的严重性均为错误

如何解决AI Platform 上所有日志的严重性均为错误

在 Google AI Platform 上,stderr 上打印的所有日志都被解释为 ERROR。 有没有办法将日志打印为 INFO、WARNING 和 CRITICAL?

enter image description here

解决方法

查看 training logs 的 AI Platform 故障排除文档。有说明You can put logging events in your application with standard Python libraries,例如logging

我还没有尝试过,但您似乎可以使用记录器对象类来设置所需的日志级别:

Logger.info(msg,*args,**kwargs)
Logs a message with level INFO on this logger. The arguments are interpreted as for debug().

Logger.warning(msg,**kwargs)
Logs a message with level WARNING on this logger. The arguments are interpreted as for debug().

Logger.critical(msg,**kwargs)
Logs a message with level CRITICAL on this logger. The arguments are interpreted as for debug().

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。