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
module 'torch' has no attribute 'device' #43
Comments
make sure you are using Also check inside your script if you can import torch and call torch device. If that doesn't work there's something wrong with the setup and you should try again installing torch. Also recommend listing your os. If you are using windows, please use WSL 2.0 with Ubuntu 18 as I have not tried on windows PowerShell. |
Also please post your complete code, as well as what commands you wrote from installation to when you execute it. That would be helpful |
I am using python 3, and pip3. I tried to import torch and no error appeared but when I tried to import torch.device that error appeared again. I have already install and reinstall torch and the problem still exist. |
I think there's a problem with your torch installation. Unfortunately I'm no familiar with how torch works and can't point you to a different direction other than check torch.version You might want to look through the issues on the torch repository. |
Or try installing with python -m pip install torch |
can you run the following code in python?
and let me know if that creates an error? |
yes of course here is the error, I think I will have to reinstall all the packages and try again maybe there is a confusion between the names so can I use this command ?: pip uninstall dl-translate @xhlulu |
Likely a confusion. Make sure there's no file named torch.py in the same directory as your code. |
@gitassia Since this is an issue with |
Hello , @xhlulu
Please find attached the part of the tutorial that I tried to execute and where I find the error.
NB : I used the guide of Pytorch to install torch according to the command appropriate to my system which is: pip3 install torch torchvision torchaudio .
The version of torch is 1.10.1 and my python version is 3.8.5 .
Thank you for your help.
The text was updated successfully, but these errors were encountered: