修改多线程的tensor方式为file_system:
torch.multiprocessing.set_sharing_strategy(‘file_system’)
默认方式为file_descriptor ,受限于open files数量
实测有效
文章介绍了如何将torch.multiprocessing的默认共享策略从file_descriptor更改为file_system,以解决因openfiles数量限制导致的问题。这种方法在多线程环境中处理Tensor时能提高效率。
修改多线程的tensor方式为file_system:
torch.multiprocessing.set_sharing_strategy(‘file_system’)
默认方式为file_descriptor ,受限于open files数量
实测有效
6092
3万+
4万+

被折叠的 条评论
为什么被折叠?
