在使用multiprocessing.Pool10.map进行多个图像下载时如何传递多个参数

问题描述

我有一种使用layout_activity.xmlrequests下载图像的方法

PIL

我想对它使用多线程/多处理。 我专门设置了此功能,以免遇到某些问题并且不能更改传递的参数或功能。如何将多个参数传递给def load_save_image_from_url(url,OUT_DIR,img_name,resize=False,resize_shape=(224,224)): ''' Save Images to disc present at a URL. Images are saved in RGB format. args: url: {str} URL string where image is present OUT_DIR: {str} Path to the output directory where you want to store the image img_name: {str} Name of image resize: {bool} Whether to resize image or not. {default: True} resize_shape: {tuple} shape of the resize image {default: (224,224)} ''' pass # download process ?我尝试使用map,但这给了我一个错误

partial
  File "/home/deshwal/anaconda3/envs/py36/lib/python3.6/multiprocessing/pool.py",line 669,in __init__
    if chunksize <= 0:
TypeError: '<=' not supported between instances of 'list' and 'int'

我什至可以这样做吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)