Issue
the import torch in my Jupiter notebook is not work, but in my terminal is works fine.
Solution
This looks like an interpreter configuration problem, your jupyter notebook is maybe using another interpreter while your terminal is using another. For eg, if you are using anaconda the default env is (base), so to add a certain module to your environment, you go to anaconda prompt and do this:
$ conda activate base
(base) $ conda install pytorch torchvision torchaudio cpuonly -c pytorch
Use the above command to install non-CUDA version of pytorch. If you're not using anaconda, you can just go to your terminal and do this:
$ workon myenv
(myenv) $ pip3 install torch torchvision torchaudio
And then try again. You need to do all this in the same environment as your jupyter notebook.
Answered By - Theorist
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.