Skip to content

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed #21

@xmg1212

Description

@xmg1212

博主你好,我的测试集是16张电镜图像,按照要求转换成key=result的mat格式了;我的真实标签是16张.png的图片,我试着让gpt写代码转换成key=groundtruth的.mat格式了。

现在运行main.py。显示如下报错 :
File "/home/xumg/graduate/PIED/impl/edges_eval_plot.py", line 48, in edges_eval_plot
pr = pr[pr[:, 1] >= 1e-3]
~~^^^^^^
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

我查看了我的eval_bdry.txt,里面只生成了一行0.010000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000。可能因为这个原因画图函数会报错。而且其他图片的ev1.txt中间的三列也全为0。我不太清楚为什么会这样,是我的真实标签生成的.mat格式有误吗?
或者有可以直接使用.png的方法吗?

非常抱歉耽误您宝贵的时间!期待博主的解答!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions