Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the environment preparation of PyTorch in JupyterLab?

Shulou Source: shulou.com Published: 2022-06-01 17:48:11 10月02日 Update

This article introduces what is the environmental preparation of PyTorch in JupyterLab. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

PyTorch is one of the mainstream deep learning frameworks, while JupyterLab is an interactive notebook environment based on Web. In JupyterLab, we can take notes and execute PyTorch code at the same time, so that we can learn, debug or review later.

Install Anaconda

Anaconda: https://www.anaconda.com/products/individual#Downloads

Beiwai Mirror Source: https://mirrors.bfsu.edu.cn/help/anaconda/

# activate base environment conda activate base to install JupyterLab

JupyterLab: https://jupyterlab.readthedocs.io/

It should have been installed with Anaconda, check the version as follows:

Jupyter-version

Otherwise, install as follows:

Conda install-c conda-forge jupyterlab

Perform jupyter lab startup, and the browser will open http://localhost:8888/:

Version < 3.0 recommends that you install the TOC extension:

Jupyter labextension install @ jupyterlab/toc

The effect of TOC directory is as follows:

Create a PyTorch environment

PyTorch: https://pytorch.org/

# create a virtual environment conda create-n pytorch python=3.8-yconda activate pytorch# install PyTorch with CUDA# NOTE: Python 3.9 users will need to add'- cymbals conda buy for 'for installationconda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.2-c pytorch-y

Compatibility of torch, torchvision and python versions

Compatibility between CUDA Toolkit and Nvidia driver versions

Nvidia Driver recommended installation method in Ubuntu

Check the PyTorch version and GPU support as follows:

$python-

Tags: Environment notes version browsing situation preparation content more browser learning help good mainstream interactive code interest method Beiwai right at the same time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Microsoft OPPO Reno Apple Shulou Tech Info