How to load the torch environment in Jupyter notebook

By default you have installed anaconda and pytorch environments.

1. You must open the Anaconda prompt terminal as an administrator.

2. Enter the pytorch environment:

conda activate pytorch_39

image.png

3. Install necessary plug-ins:
(1) conda install nb_conda
(2) conda install ipykernel

4. Enter the following command in the Anaconda prompt to start:

jupyte notebook

image.png

In the new file, you can see that the torch-based core can be called.
image.png

reference:

[Anaconda has pytorch installed, but jupyter keeps showing No module named 'torch']
https://blog.51cto.com/u_15440206/4666445

[jupyter notebook loads torch and tensorflow in conda virtual environment]
https://blog.csdn.net/duohuanxi/article/details/121635848

Guess you like

Origin blog.csdn.net/Alexa_/article/details/134172103