ImportError: cannot import name '_update_worker_pids'
See original GitHub issueMy setup:
- Ubuntu 18.04.02
- CUDA 10.0
- PyTorch 1.1
- Python3.5
Well, I tried to run the demo using:
chmod +x demo_test.sh
./demo_test.sh
but the error came out:
Traceback (most recent call last): File “test.py”, line 11, in <module> from dataset import TestDataset File “/home/nhan/git_workspace/semantic-segmentation-pytorch/dataset.py”, line 4, in <module> import lib.utils.data as torchdata File “/home/nhan/git_workspace/semantic-segmentation-pytorch/lib/utils/data/init.py”, line 3, in <module> from .dataloader import DataLoader File “/home/nhan/git_workspace/semantic-segmentation-pytorch/lib/utils/data/dataloader.py”, line 3, in <module> from torch._C import _set_worker_signal_handlers, _update_worker_pids,
ImportError: cannot import name ‘_update_worker_pids’
What is the problem? Can you help me to solve it? Thanks.
Update 28 Mar 2019: Problem resolved. Rebuilding Pytorch v1.0.0 from source and it works now.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Top GitHub Comments
Though I see this issue has been solved by reinstalling pytorch version 1.0.1. But for those who has updated to 1.1.0 and does not want to downgrade. You can simply replace
_update_worker_pids
with_set_worker_pids
. It works for me after replacement and I think it’s just a simple rename issue.This is due to update of dataloader in pytorch1.1(For example. this part is move to data._utils.worker.py file), you need to rewrite this.