# pytorchstudy **Repository Path**: xvlie/pytorchstudy ## Basic Information - **Project Name**: pytorchstudy - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-12 - **Last Updated**: 2025-10-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 整个创建 查看python 版本 python —V 查看conda版本 conda -V 初始化conda conda init powershell conda init cmd.exe 创建虚拟环境 conda create -n envpytorch python=3.10 conda remove --name envpytorch --all 激活虚拟环境 conda activate envpytorch conda deactivate 查看所有的虚拟环境 conda env list (envpytorch) PS D:\python-study1\pytorchStudy> conda env list # conda environments: # base D:\miniconda3 envpytorch * D:\miniconda3\envs\envpytorch sel D:\miniconda3\envs\sel D:\python-study1\yolo2\yolov8 查看虚拟环境中安装了多少包 (envpytorch) PS D:\python-study1\pytorchStudy> pip list 查看GPU型号 NVIDIA GeForce RTX 4060 Laptop GPU +-----------------------------------------+------------------------+----------------------+ 下载显卡驱动 https://www.nvidia.cn/geforce/drivers/ 根据显卡类型 安装下面驱动 581.29-notebook-win10-win11-64bit-international-nsd-dch-whql.exe 显卡驱动 检查是否安装cuda (envpytorch) PS D:\python-study1\pytorchStudy> nvidia-smi 表明最高支持cuda 13.0 但可以用12.9 Sun Sep 14 12:30:21 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 581.29 Driver Version: 581.29 CUDA Version: 13.0 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 4060 ... WDDM | 00000000:01:00.0 On | N/A | | N/A 44C P8 5W / 80W | 638MiB / 8188MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ 查询目录https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html 因选用 CUDA 12.9 查询https://developer.nvidia.com/cuda-toolkit-archive(要登录的) 下载cuda toolkit 12.9 cuda_12.9.0_576.02_windows.exe 查询https://developer.nvidia.com/rdp/cudnn-archive 下载cuda加速器 cuDNN 验证是否安装了cuda toolkit 12.2 C:\Users\Lenovo>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Tue_Aug_15_22:09:35_Pacific_Daylight_Time_2023 Cuda compilation tools, release 12.2, V12.2.140 Build cuda_12.2.r12.2/compiler.33191640_0 +-----------------------------------------+------------------------+----------------------+ 安装pytorch conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia 卸载pytorch conda uninstall pytorch torchvision torchaudio pip uninstall torch torchvision 查看cuda 是否安装 >>> import torch >>> torch.cuda.is_available() True >>> torch.__version__ '2.5.1' 是cpu版本 如何git 到gitee 上。 (envpytorch) PS D:\python-study1\pytorchStudy> git init (envpytorch) PS D:\python-study1\pytorchStudy> git remote add origin https://gitee.com/xvlie/pytorchstudy.git