Installation of PyTorch (ANACONDA+PyCharm)

1. Concept

1. What is PyTorch

PyTorch是一个开源的机器学习框架,用于构建深度学习模型。它由Facebook的人工智能研究院(Facebook AI Research)开发和维护,并于2016年首次发布。
PyTorch提供了一个灵活而高效的计算图和自动微分系统,使得开发者能够轻松地定义和训练各种类型的神经网络模型。
PyTorch的设计目标之一是提供简洁、易于使用的API,以便开发者能够更加专注于模型的设计和实验。与其他深度学习框架相比,PyTorch具有更为动态的计算图,这意味着它能够在运行时根据需要灵活地构建和修改计算图,从而方便了模型的调试和动态计算需求的处理。
PyTorch支持许多常用的深度学习任务,包括图像分类、目标检测、自然语言处理等。它还提供了丰富的工具和库,用于数据加载和预处理、模型构建、模型训练和推断等方面的任务。此外,PyTorch还提供了一些高级功能,如分布式训练、模型部署和量化等,使得在大规模和实际应用中使用深度学习更加便捷。

2.What is ANACONDA?

Anaconda是一个用于科学计算和数据科学的Python发行版和环境管理器。它集成了许多常用的科学计算和数据分析库,使得安装和管理这些库变得更加简单和方便。
Anaconda包含了Python解释器及其核心库,以及众多常用的第三方库,如NumPy、Pandas、Matplotlib、SciPy等。这些库是进行科学计算、数据分析和机器学习所必需的关键工具。
Anaconda还提供了一个名为Conda的包管理系统,使用户可以轻松地安装、更新和管理这些库及其依赖关系。
Anaconda的一个主要优势是它的跨平台性。它可以在Windows、macOS和Linux等操作系统上运行,并提供了统一的界面和命令行工具,以简化库的安装和环境配置。用户可以轻松地创建和管理多个独立的Python环境,每个环境可以具有不同版本的Python和库,从而实现项目之间的隔离和灵活性。
通过Anaconda,用户可以更容易地搭建适用于科学计算和数据科学的工作环境,无需手动安装和配置各种库和依赖项。此外,Anaconda还提供了一些额外的工具和服务,如Anaconda Navigator(一个图形用户界面),以及Anaconda Cloud(一个用于共享和分发代码、数据和环境的平台),进一步提升了工作效率和协作能力。

In summary: ANACONDA is essentially a package manager and environment manager

3. What is PyCharm

PyCharm是一种由JetBrains开发的集成开发环境(IDE),专门用于Python开发。
它提供了丰富的功能和工具,帮助开发者提高编写、调试和部署Python代码的效率。

In general: PyCharm is a development tool like Java’s IDEA, shortening development time

2. Installation of PyTorch

1. Install ANACONDA and PyCharm (just click Next)

insert image description here
insert image description here
Here is an explanation of why ANACONDA is an environment manager.
Open Anaconda Prompt and enter the command conda env listto see that there is only one basic environment:
insert image description here
View the python version of the current environment: 3.10.9
insert image description here
At this time we configure a new environment: activate the environment. conda create -n (新环境名字) (指定python的版本)
insert image description here
View
insert image description here
the python version of the current environment. 3.8.2
insert image description here
Please install PyCharm yourself!

2. Configure ANACONDA with pycharm

insert image description here
insert image description here

ok already done

3. Install pytorch environment

Query the CUDA version
insert image description here
and download the corresponding CUDA version of PyTorch (backwards compatible)
insert image description here

Report an error
insert image description here
. View the download source conda config --show-sources
insert image description here
. Switch to the Tsinghua University source https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
insert image description here
to modify your own files.
insert image description here
Run conda clean -i clear index cache to ensure that the index provided by the mirror station is used.
insert image description here
Reinstall pytorch
to test whether the installation is successful.
insert image description here
Test pycharm
insert image description here
insert image description here
ok!

Guess you like

Origin blog.csdn.net/qq_45637894/article/details/131528881