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

Error: from torch._C import _set_worker_signal_handlers, _update_worker_pids, #19

Open
AtefehBaniasadi opened this issue Mar 27, 2021 · 21 comments

Comments

@AtefehBaniasadi
Copy link

Hi,

First of all, thank you for your work, when I wanted to test your model i faced this error

from torch._C import _set_worker_signal_handlers, _update_worker_pids,
ImportError: cannot import name '_update_worker_pids'

I thought the error may be related to pythorch version so I changed it but the error didn't resolve, can you please guide me on how I can address the problem?

Thanks in advance.

@mazzzystar
Copy link

@SuJiaKuan
Copy link

In README, the author says the model is built in PyTorch 0.4.0, PyTorch 0.4.1. Install PyTorch version 0.4.1 works for me.

If you use Conda, you can install PyTorch 0.4.1 by following command:

conda install pytorch=0.4.1 torchvision==0.2.1 cuda90 -c pytorch

@abbaskali
Copy link

if i have pytorch=1.10.0 is it possible to run this code or shall I return to pytorch =0.4.1 ?

@SuJiaKuan
Copy link

@abbaskali Please return to PyTorch 0.4.1 because the APIs changes a lot from version 0.X to 1.X

@abbaskali
Copy link

@SuJiaKuan thank you a lot sir for your advice, could you help me with another question, I need Pytorch 1.10.0 so do you think is it possible to create another environment on my machine and install PyTorch 0.4.1 to run this code better?
thank you once again

@SuJiaKuan
Copy link

@abbaskali Yes, it is possible. Conda is a very nice tool for Python packages and environment management. Under Conda, you can create separate environments for different purposes, for example, one environment for Pytorch 1.10.0 and one for Pytorch 0.4.1.

The tutorial of Conda.

Example commands to create an environment for PyTorch 0.4.1:

conda create --name ridnet python=3.7
conda activate ridnet
conda install pytorch=0.4.1 torchvision==0.2.1 cuda90 -c pytorch

@abbaskali
Copy link

@SuJiaKuan thank you a lot for your great explanation, I appreciate it, sir, my cuda is 11.4 is it okay for "conda install pytorch=0.4.1 torchvision==0.2.1 cuda90 -c pytorch"?

@SuJiaKuan
Copy link

@abbaskali Yes, it is. The command also installs Cuda 9.0 (cuda90) that is separate from your own cuda (Cuda 11.4), so just feel free and try it.

@abbaskali
Copy link

@SuJiaKuan yes sir, i will do it, thank you for your help, God bless you

@abbaskali
Copy link

anybody can help me I got this problem:
from torch.utils.data import _utils
ImportError: cannot import name 'utils' from 'torch.utils.data' (C:\ProgramData\Miniconda3\envs\ridnet\lib\site-packages\torch\utils\data_init.py)

@abbaskali
Copy link

dear dr.@SuJiaKuan, i am sorry to bother you, this code is available for Ubuntu can I implement it on windows? or should I install the Ubuntu terminal? thank you

@SuJiaKuan
Copy link

SuJiaKuan commented Nov 1, 2021

@abbaskali I'm, a Linux user, so I'm not sure the code works well or not on Windows. Most popular Python / Deep Learning tools (e.g., Conda) support both Linux and Windows, and I guess it is very possible to run the project on Windows. From my perspective, most (Deep Learning) tools are native built on Linux, so it is recommended to learn and develop projects on Linux. :D

@abbaskali
Copy link

Dr. @SuJiaKuan thankful for you helping

@abbaskali
Copy link

dear dr. @SuJiaKuan
i got this problem could you help me please
ModuleNotFoundError: No module named 'model.edsr'

@SuJiaKuan
Copy link

@abbaskali Do you run the code under directory TestCode/code?

@abbaskali
Copy link

@abbaskali Do you run the code under directory TestCode/code?

yes sir, run it on this directory

@SuJiaKuan
Copy link

@abbaskali I don't see any file like edsr.py in TestCode/code/model. If you create edsr.py by yourself, please make sure the file is located at the right directory. If not, please just delete the importing line and try it again.

@ttrfly
Copy link

ttrfly commented Jan 5, 2022

任何人都可以帮助我我遇到了这个问题: from torch.utils.data import _utils ImportError: cannot import name ' _utils' from 'torch.utils.data' (C:\ProgramData\Miniconda3\envs\ridnet\lib\site-packages \火炬\ utils的\ data_中_初始化__的.py)

How did you solve this problem?

@SuJiaKuan
Copy link

In README, the author says the model is built in PyTorch 0.4.0, PyTorch 0.4.1. Install PyTorch version 0.4.1 works for me.

If you use Conda, you can install PyTorch 0.4.1 by following command:

conda install pytorch=0.4.1 torchvision==0.2.1 cuda90 -c pytorch

@ttrfly See this comment.

@ttrfly
Copy link

ttrfly commented Jan 5, 2022 via email

@SuJiaKuan
Copy link

SuJiaKuan commented Jan 5, 2022

@ttrfly Please check the PyTorch version by running:

pip show torch

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

5 participants