Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name '_update_worker_pids' #37

Open
shazib-summar opened this issue May 7, 2020 · 5 comments
Open

ImportError: cannot import name '_update_worker_pids' #37

shazib-summar opened this issue May 7, 2020 · 5 comments

Comments

@shazib-summar
Copy link

shazib-summar commented May 7, 2020

Specs:
OS: Ubuntu 18.04
PyTorch: 1.3.1
Python: 3.6.9

Command:
python3 main.py --model san --data_test MyImage --save save_name --scale 4 --n_resgroups 20 --n_resblocks 10 --n_feats 64 --reset --chop --save_results --test_only --testpath 'your path' --testset Set5 --pre_train ../model/SAN_BIX4.pt

Output:

  File "main.py", line 4, in <module>
    import data
  File "<some_directory_containing_SAN>/SAN/TestCode/code/data/__init__.py", line 3, in <module>
    from dataloader import MSDataLoader
  File "<some_directory_containing_SAN>/SAN/TestCode/code/dataloader.py", line 10, in <module>
    from torch._C import _set_worker_signal_handlers, _update_worker_pids, \
ImportError: cannot import name '_update_worker_pids'

Problem
Upon running the specified command, the provided output is returned. I'm confused as to how everyone else has been able to run the network.
Any help would be sincerely appreciated.

@Akshaypatil7
Copy link

Have you solved this problem

@shazib-summar
Copy link
Author

TLDR: No

This is due to version mismatch of PyTorch. This model, I believe, is based on PyTorch 0.3.1. If you use this version, this issue does not occur. Now this gives rise to a new problem as PyTorch 0.3.1 is old school. You could modify the code so that it can run on PyTorch 1.4 or whatever version you have. So, I guess it up to how seriously do you need this specific model, otherwise, there are quite a few other SR GANs available.

You might want to see this, this and specifically this comment

@liucong521
Copy link

Has this problem been solved? How to solve it, can you teach me?

@shazib-summar
Copy link
Author

@liucong12345678 see my above-mentioned comment

@prakanshuls22
Copy link

The version conflict is just a rename issue I guess.
You can try to replace _update_worker_pids with _set_worker_pids.
I think it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants