1

I am trying to import worker_manager_loop as follows:

from torch.utils.data.dataloader import _worker_manager_loop

I get an error that says: cannot import name '_worker_manager_loop' from 'torch.utils.data.dataloader'

I looked up this problem and realized that _worker_manager_loop was replaced with _pin_memory_loop after Pytorch 1.0.0 (according to this). However, even after doing the recommended fix, I still get this error: cannot import name '_pin_memory_loop' from 'torch.utils.data.dataloader'

I know that the most straightforward thing I can do is downgrade my Pytorch to 1.0, but I would like to know what _pin_memory_loop was renamed to in version 1.7, as I would like to avoid downgrading. My Pytorch version is 1.7.1 with Python 3.7.6 and cudnn 7.6.5 Cuda 10.0 on Windows 10.

Nour
  • 197
  • 1
  • 3
  • 13
  • I also have a similar issue, but not related to the loader. It is dependent on torch.utils.data itself, can not import from data_utils.py – Snowball Apr 26 '22 at 07:03

1 Answers1

0

I also have a similar issue, So I import it like this

same pytorch veriosn (1.7.1)

from torch.utils.data._utils.pin_memory import _pin_memory_loop
moken
  • 3,227
  • 8
  • 13
  • 23
Yeong
  • 1