How do I know the current version of pytorch?
import torch print(torch.__version__)
Just for the record:
to check it from terminal in linux:
python -c "import torch; print(torch.__version__)"
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?
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.
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'