multiple tqdm progress bars when using joblib parallel

放肆的年华 提交于 2020-04-16 07:51:10

问题


I’ve a function:

def func(something):
    for j in tqdm(something):
        ...

which is called by:

joblib.Parallel(n_jobs=4)((joblib.delayed)(s) for s in something_else)

Now, this creates 4 overlapping tqdm progress bars. Is it possible to get 4 separate ones that update independently?


回答1:


EDIT: I was sent this discussion by a friend in which a much cleaner solution is provided. I wrote a quick performance test to make sure that the lock does not cause the threads to block each other. There was no performance hit even when updating bars every millisecond. I recommend that you use that solution instead.

The previous answer has been removed.



来源:https://stackoverflow.com/questions/57112314/multiple-tqdm-progress-bars-when-using-joblib-parallel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!