若在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顯示。