ubuntu安装torch

检查服务器cuda版本:

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

如下,显示cuda是11.5版本,可以 使用cuda11.8,具体可以 问豆包

安装

检查pip源,不要使用aliyun的源,只有几十k的下载速度

(.venv) pc:/data/python/ pip config list
global.index-url='https://mirrors.aliyun.com/pypi/simple/'

使用pytorch的专用镜像,有10M的速度

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

image-20250530102903534

posted @ 2025-05-30 10:28  hujiawei  阅读(43)  评论(0)    收藏  举报