tensorboard出现OSError: [Errno 22] Invalid argument问题解决

半城伤御伤魂 提交于 2020-03-08 13:26:08

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的变化了。
附上参考链接

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!