I installed pytorch via
conda install pytorch-cpu torchvision-cpu -c pytorch
And I also tried
pip3 install https://download.pytorch
Check SDK install. you also install the sdk in your environment.
You can install the SDK using navigator.
first, change tab to Environments,
second, push play button of your environment name.
Third, then install SDK.
I had the same problem after following the official installation guide in here. I realized that it was my stupid Atom built-in terminal.
Inside the atom terminal, which python
returned /usr/bin/python, although it showed the mark of (conda_env)$.
I fixed it by opening a new terminal and activating the (conda_env), and it worked. Verified and which python
yields /Users/my_usr/anaconda3/envs/conda_env/bin/python
I installed on my macos by the official command:
conda install pytorch torchvision -c pytorch
but when I follow the official verification I get the same problem like yours.
Then I create a conda virtual environment:
conda create --name learnpytorch python=3.5
and install pytorch inside the environment:
conda install pytorch torchvision -c pytorch
run the verification, it works.
Hope these could help you.
You need to add this at the very top of your program
import torch
If this is not a problem execute this program on both Jupiter and command line and pretty much you will understand if you have a mismatch.
import sys
print(sys.executable)
Create the environment:
conda create -n env_pytorch python=3.6
Install your modules. For example:
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Next time you want to use pytorch:
conda activate env_pytorch
and when finished:
conda deactivate
Make sure that NumPy and Skipy libraries are installed before installing the torch library that worked for me at least on windows.
step 1. Install NumPy: pip install numpy
step 2. Install Skipy: pip install skipy
step 3. Go to pytorch.org and select your needs and copy the address
step 4. Paste the address and download
Hope that works for you as well ( :