pytorch different versions with "pip3 show torch" VS "torch.__version__"
When checking the installed pytorch version you can do that in two ways:

pip3 show torch (or similar python3 -m pip freeze for all packages)
import torch; torch.__version__

Interestingly the first option (using pip3) returns 1.8.1+cu111, while the second option (torch.__version__) returns 1.7.1 (without the cuda version support string, but cuda is available).
Why do these two methods show different results and which one is the &quot;valid&quot; one?
Important
When I installed pytorch with cuda support I installed the latest version, but downgraded a few weeks ago for different reasons.
Some info:

OS: ubuntu
python installed natively (not in conda, also not using jupyter)


This typically happens when you have multiple versions of the same library installed for some reason (normally mixing conda install and pip install in my experience). I recommend uninstalling oldest versions using the appropriate package manager until you see the expected behavior.
