AttributeError NoneType object has no attribute set_cursor修复方法

AttributeError: ‘NoneType’ object has no attribute 'set_cursor’修复方法

一,问题描述

在运行yolov3是出现这个错误

File "/home/user/.local/lib/python3.7/site-packages/matplotlib/backends/backend_gtk3.py", line 468, in set_cursor
    self.canvas.get_property("window").set_cursor(cursord[cursor])

AttributeError: 'NoneType' object has no attribute 'set_cursor'

是因为matplotlib在读取图片是出现一些异常。

二,解决方法

import matplotlib
matplotlib.use(‘Agg’)

在程序引用matplotlib后面加上一句matplotlib.use(‘Agg’)

你可能感兴趣的:(AttributeError NoneType object has no attribute set_cursor修复方法)