Luchspeter
Luchspeter

Reputation: 794

pytorch different versions with "pip3 show torch" VS "torch.__version__"

When checking the installed pytorch version you can do that in two ways:

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 "valid" 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:

Upvotes: 0

Views: 2253

Answers (1)

erip
erip

Reputation: 16935

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.

Upvotes: 1

Related Questions