linux(阿里云)安装pytorch

目录

环境

安装步骤

[1 检查python3和pip3是否已经安装](#1 检查python3和pip3是否已经安装)

[2 安装pytorch](#2 安装pytorch)

[3 安装完毕,检查pytorch版本](#3 安装完毕,检查pytorch版本)


环境

阿里云 ubuntu 22.04 UEFI版 64位

安装步骤

1 检查python3和pip3是否已经安装

输入下面两条指令:

bash 复制代码
python3 --version
bash 复制代码
pip --version

检查发现,ubuntu22.04已经预装了python 3及pip

2 安装pytorch

根据pytorch官网的描述,选择linux, cpu, pip, python的配置,获得对应的安装指令:

bash 复制代码
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

执行上面的指令。

3 安装完毕,检查pytorch版本

安装完毕,出现"Successfully installed"字样:

输入如下指令,检查pytorch版本:

bash 复制代码
python3 -c "import torch; print(torch.__version__)"
相关推荐
花酒锄作田7 小时前
Pydantic校验配置文件
python
hboot7 小时前
AI工程师第四课 - 深度学习入门
pytorch·python·神经网络
ZhengEnCi18 小时前
P2M-Matplotlib折线图完全指南-从数据可视化到趋势分析的Python绘图利器
python·matlab·数据可视化
ZhengEnCi19 小时前
P2L-Matplotlib饼图完全指南-从数据可视化到图表定制的Python绘图利器
python·matlab
曲幽19 小时前
你的REST接口还在“过度投喂”数据吗?——FastAPI + GraphQL实战避坑指南
python·fastapi·web·graphql·route·cors·rest·strawberry
用户83580861879120 小时前
基于 Self-RAG 与列表级重排序的进阶 RAG 系统设计与实现
python
Warson_L2 天前
Python `Annotated` 与 LangGraph Reducer 学习笔记
python
韩师傅2 天前
海天线算法的前世今生
python·计算机视觉
韩师傅2 天前
当你的甲方设备过烂,要如何快速出效果?
python·计算机视觉
Warson_L2 天前
LangGraph的MessageState and HumanMessage
python