错误Matplotlib is building the font cache using fc-list. This may take a moment.

时间:2023-03-10 07:20:06
错误Matplotlib is building the font cache using fc-list. This may take a moment.

这上面的错误是因为你环境中没有安装GUI工具,但是你在代码中又想要显示图片,即有下面的语句:

    plt.imshow(np.transpose(npimg, (, , )))
plt.show()

那么就会报上面的错误,如果想要查看图像的话,建议你将其存到文件夹中查看

即将上面的代码改为:

    plt.imshow(np.transpose(npimg, (, , )))
plt.savefig('./data/out_image/'+name)