AttributeError: module ‘matplotlib‘ has no attribute ‘image‘
程序员文章站
2022-03-18 20:40:48
...
every blog every motto: We would rather reuse an active dwarf than a sleeping giant.
0. 前言
记录
1. 正文
报错
AttributeError: module 'matplotlib' has no attribute 'image'
代码如下
import matplotlib
print(matplotlib.__version__)
y_true = matplotlib.image.imread("./data/gt/labels_41r_51c.tif")
print("y-true", y_true)
解决方法
代入时,导入如下即可
import matplotlib.image as img
完整代码
import matplotlib
import matplotlib.image as img
y_true = matplotlib.image.imread("./data/gt/labels_41r_51c.tif")
奇怪的解决方法……
上一篇: 机器学习——python之matplotlib的使用——①
下一篇: AttributeError: module ‘matplotlib‘ has no attribute ‘interactive‘
推荐阅读
-
python错误:AttributeError: 'module' object has no attribute 's
-
python编程排除163邮箱发送邮件报错(AttributeError: ‘tuple‘ object has no attribute ‘encode‘)
-
python编程排除163邮箱发送邮件报错(AttributeError: ‘tuple‘ object has no attribute ‘encode‘)
-
module ‘seaborn‘ has no attribute ‘scatterplot‘解决方案
-
AttributeError: module ‘community‘ has no attribute ‘best_partition‘ 问题解决方法
-
module ‘community‘ has no attribute ‘best_partition‘ [已解决]
-
【python】解决AttributeError: module ‘scipy.misc‘ has no attribute ‘toimage‘问题
-
【Tensorflow】Linux下Tensorflow报错:AttributeError: module ‘tensorflow‘ has no attribute ‘xxxx‘
-
AttributeError: 'module' object has no attribute 'main'
-
AttributeError: module 'sklearn' has no attribute 'linear_model'