tensorboard出现OSError: [Errno 22] Invalid argument问题解决
问题描述
使用tensorboard的时候提示错误:
W0308 10:12:12.621754 13516 plugin_event_accumulator.py:557] Detected out of order event.step likely caused by a TensorFlow restart. Purging 428 expired tensor events from Tensorboard display between the previous step: 3997 (timestamp: 1583631015.1091805) and current step: 3812 (timestamp: 1583631855.272426).
for k in _TENSORBOARD_INFO_FIELDS
File "d:\anaconda\lib\site-packages\tensorboard\manager.py", line 129, in <dictcomp>
for k in _TENSORBOARD_INFO_FIELDS
File "d:\anaconda\lib\site-packages\tensorboard\manager.py", line 51, in <lambda>
(dt - datetime.datetime.fromtimestamp(0)).total_seconds()),
OSError: [Errno 22] Invalid argument
解决方案
在anaconda\lib\site-packages\tensorboard\manager.py文件中找到第50-51行,将
serialize=lambda dt: int(dt - datetime.datetime.fromtimestamp(0)).total_seconds())
改为
serialize=lambda dt: int(dt.strftime("%S"))
问题解决,可以正常使用tensorboard来监控损失函数loss的变化了。
附上参考链接!
来源:CSDN
作者:行者无疆哇
链接:https://blog.csdn.net/weixin_41608328/article/details/104728273