How do I know the current version of pytorch?
11 Likes
import torch
print(torch.__version__)
50 Likes
Just for the record:
to check it from terminal in linux:
python -c "import torch; print(torch.__version__)"
29 Likes
So quick question here. When I check from Jupyter, I’m able to see the version printed but when I do the same from terminal, I get import error: no module named torch. Can you please help me out here?
Thanks.
I’m guessing jupyter is running in a different python environment than your default one.
The first thing to try would be to see what happens if you replace ‘python’ with ‘python3’ at the start of that command.
2 Likes
Thank you. That was it.
Thank you. It was very helpful!
with torch.version it gives
module ‘torch’ has no attribute ‘version’
Did you use the two underscores in the command as it’s working fine:
>>> import torch
>>> torch.__version__
'1.9.0a0+df837d0'
3 Likes