matplotlib
文章平均质量分 92
alphanoblaker
这个作者很懒,什么都没留下…
展开
-
python multiprocessing.Process与threading.Thread的区别以及多进程,多线程的一些使用方法
在前置的学习过程中遇到了tensorflow的一些问题,就想着用进程或者线程来解决。但是使用过程中出现了不少bug,才有了本文概述Process跟Thread的一些区别如下(不一定全面,只是自己使用中总结的):(下文中会分别用代码说明)首先是内存共享的问题。Thread创建的子线程可以直接使用主线程的变量数据;而Process创建的子进程跟主进程是完全隔离的,如果要用到主进程的变量,就必须作为参数传入,即使将所需变量设置为global也无效(因为设置.原创 2022-03-24 16:20:35 · 2459 阅读 · 0 评论 -
pyplot.plot使用遇到:UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail
在threading.Thread创建的线程中使用了matplotlib.pyplot来做图,但出现:UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail之后查找Matplotlib官方文档,有这样的描述:Working with threads:Matplotlib is not thread-safe: in fact, there ar.原创 2022-03-23 17:27:15 · 15464 阅读 · 7 评论