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

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

    plt.imshow(np.transpose(npimg, (1, 2, 0)))
    plt.show()

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

即将上面的代码改为:

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

猜你喜欢

转载自www.cnblogs.com/wanghui-garcia/p/10560179.html