若在coco
import之后再import matplotlib,那么plt就不显示图像了,若想显示图像,需在其之前import。
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
The backend was *originally* set to 'module://backend_interagg' by the following code:
File "E:/Ship_Detection/SSDD-Dataset-Analysis/debug_count_size_distribution.py", line 10, in <module>
import matplotlib.pyplot as plt
File "C:\Software\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 71, in <module>
from matplotlib.backends import pylab_setup
File "C:\Software\Anaconda3\lib\site-packages\matplotlib\backends\__init__.py", line 16, in <module>
line for line in traceback.format_stack()
import matplotlib; matplotlib.use('Agg')
coco 中会将matplotlib.use()中修改从而影响plt显示。