Since PyTorch seems to adopt lazy way of initializing workers, this means that the actual file opening has to happen inside of the getitem function of the Dataset wrapper.
https://discuss.pytorch.org/t/dataloader-when-num-worker-0-there-is-bug/25643/2

本文探讨了PyTorch中DataLoader的工作机制,特别是在num_workers设置为0时的行为。指出由于PyTorch采用懒初始化方式,实际文件打开操作必须在Dataset的getitem函数内进行。
948

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



