您的位置:首页 > Web前端

caffe 根据训练输出的log 绘制accuracy loss 曲线时遇到 IndexError:list index out of range

2017-08-02 18:16 746 查看
 /home/wcs/caffe/tools/extra/plot_training_log.py.example 6 train_loss_iters_60000.png ResNet152-2017-08-01-12-49-30.log

以上是我用caffe 自带的工具plot_training_log.py.example绘制曲线的命令行, 分别表示  工具所在/曲线类别/输出图像的名字/日志所在

运行后出现错误

Traceback (most recent call last):

  File "/home/wcs/caffe/tools/extra/plot_training_log.py.example", line 184, in <module>

    plot_chart(chart_type, path_to_png, path_to_logs)

  File "/home/wcs/caffe/tools/extra/plot_training_log.py.example", line 117, in plot_chart

    data = load_data(data_file, x, y)

  File "/home/wcs/caffe/tools/extra/plot_training_log.py.example", line 88, in load_data

    data[1].append(float(fields[field_idx1].strip()))

IndexError: list index out of range

这个错误的原因是因为最后一次迭代没有完全结束,我的log 是在没有训练完的情况下取出画图想查看效果的,所以才出了这个错误

打开你的日志,直接拉到最后一行,删除不完整的迭代记录,然后按照网上的画图教程重新来一遍就行了,记住是重新来,因为前面产生的log.test和log.train

文件中最后一行也可能不完整
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: