Итак, я запускал код ранее и получил следующее предупреждение:
Warning (from warnings module):
File "<string>", line 558
RuntimeWarning: More than 20 figures have been opened. Figures created through
the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly
closed and may consume too much memory. (To control this warning, see the rcParam
`figure.max_open_warning`).
Warning (from warnings module):
File "<string>", line 665
RuntimeWarning: More than 20 figures have been opened. Figures created through
the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly
closed and may consume too much memory. (To control this warning, see the rcParam
`figure.max_open_warning`).
Не собираюсь l ie, я был очень небрежен и все равно запускал его, игнорируя предупреждение. Теперь, когда я пытаюсь запустить скрипт, моя оболочка python не запускает скрипт.
Поэтому я пытаюсь удалить графики из памяти, чтобы позволить мне снова запустить скрипт.
Я попробовал следующее, и он все еще не позволяет мне запустить код:
plt.clf()
plt.cla()
f = plt.figure()
f.clear()
plt.close(f)
plt.close('all')
matplotlib.pyplot.figure().clear()
matplotlib.pyplot.close()
Как я могу решить эту проблему?