- PyTorch: 2.5.0
- TorchVision: 0.20.0
- Torchaudio: 2.5.0
- PyTorch CUDA: 11.8
(yolov8) D:\Miniconda3\envs\yolov8>conda install pytorch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 pytorch-cuda=11.8 -c pytorch -c nvidia
Channels:
- pytorch
- nvidia
- defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: D:\Miniconda3\envs\yolov8
added / updated specs:
- pytorch-cuda=11.8
- pytorch==2.5.0
- torchaudio==2.5.0
- torchvision==0.20.0
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2024.11.26 | haa95532_0 132 KB
cuda-cccl-12.4.127 | 0 1.4 MB nvidia
cuda-cudart-11.8.89 | 0 1.4 MB nvidia
cuda-cudart-dev-11.8.89 | 0 723 KB nvidia
cuda-cupti-11.8.87 | 0 11.5 MB nvidia
cuda-libraries-11.8.0 | 0 1 KB nvidia
cuda-libraries-dev-11.8.0 | 0 1 KB nvidia
cuda-nvrtc-11.8.89 | 0 72.1 MB nvidia
cuda-nvrtc-dev-11.8.89 | 0 16.1 MB nvidia
cuda-nvtx-11.8.86 | 0 43 KB nvidia
cuda-profiler-api-12.4.127 | 0 19 KB nvidia
cuda-runtime-11.8.0 | 0 1 KB nvidia
libcublas-11.11.3.6 | 0 33 KB nvidia
libcublas-dev-11.11.3.6 | 0 375.9 MB nvidia
libcufft-10.9.0.58 | 0 6 KB nvidia
libcufft-dev-10.9.0.58 | 0 144.6 MB nvidia
libcurand-10.3.5.147 | 0 4 KB nvidia
libcurand-dev-10.3.5.147 | 0 49.7 MB nvidia
libcusolver-11.4.1.48 | 0 29 KB nvidia
libcusolver-dev-11.4.1.48 | 0 94.1 MB nvidia
libcusparse-11.7.5.86 | 0 13 KB nvidia
libcusparse-dev-11.7.5.86 | 0 175.7 MB nvidia
libnpp-11.8.0.86 | 0 294 KB nvidia
libnpp-dev-11.8.0.86 | 0 143.2 MB nvidia
libnvjpeg-11.9.0.86 | 0 4 KB nvidia
libnvjpeg-dev-11.9.0.86 | 0 1.9 MB nvidia
pytorch-2.5.0 |py3.10_cuda11.8_cudnn9_0 1.39 GB pytorch
pytorch-cuda-11.8 | h24eeafa_6 7 KB pytorch
pytorch-mutex-1.0 | cuda 3 KB pytorch
torchaudio-2.5.0 | py310_cu118 7.0 MB pytorch
torchvision-0.20.0 | py310_cu118 7.7 MB pytorch
------------------------------------------------------------
Total: 2.46 GB
The following NEW packages will be INSTALLED:
cuda-cccl nvidia/win-64::cuda-cccl-12.4.127-0
cuda-cudart nvidia/win-64::cuda-cudart-11.8.89-0
cuda-cudart-dev nvidia/win-64::cuda-cudart-dev-11.8.89-0
cuda-cupti nvidia/win-64::cuda-cupti-11.8.87-0
cuda-libraries nvidia/win-64::cuda-libraries-11.8.0-0
cuda-libraries-dev nvidia/win-64::cuda-libraries-dev-11.8.0-0
cuda-nvrtc nvidia/win-64::cuda-nvrtc-11.8.89-0
cuda-nvrtc-dev nvidia/win-64::cuda-nvrtc-dev-11.8.89-0
cuda-nvtx nvidia/win-64::cuda-nvtx-11.8.86-0
cuda-profiler-api nvidia/win-64::cuda-profiler-api-12.4.127-0
cuda-runtime nvidia/win-64::cuda-runtime-11.8.0-0
libcublas nvidia/win-64::libcublas-11.11.3.6-0
libcublas-dev nvidia/win-64::libcublas-dev-11.11.3.6-0
libcufft nvidia/win-64::libcufft-10.9.0.58-0
libcufft-dev nvidia/win-64::libcufft-dev-10.9.0.58-0
libcurand nvidia/win-64::libcurand-10.3.5.147-0
libcurand-dev nvidia/win-64::libcurand-dev-10.3.5.147-0
libcusolver nvidia/win-64::libcusolver-11.4.1.48-0
libcusolver-dev nvidia/win-64::libcusolver-dev-11.4.1.48-0
libcusparse nvidia/win-64::libcusparse-11.7.5.86-0
libcusparse-dev nvidia/win-64::libcusparse-dev-11.7.5.86-0
libnpp nvidia/win-64::libnpp-11.8.0.86-0
libnpp-dev nvidia/win-64::libnpp-dev-11.8.0.86-0
libnvjpeg nvidia/win-64::libnvjpeg-11.9.0.86-0
libnvjpeg-dev nvidia/win-64::libnvjpeg-dev-11.9.0.86-0
pytorch pytorch/win-64::pytorch-2.5.0-py3.10_cuda11.8_cudnn9_0
pytorch-cuda pytorch/win-64::pytorch-cuda-11.8-h24eeafa_6
sympy pkgs/main/win-64::sympy-1.13.2-py310haa95532_0
torchvision pytorch/win-64::torchvision-0.20.0-py310_cu118
typing_extensions pkgs/main/win-64::typing_extensions-4.11.0-py310haa95532_0
The following packages will be UPDATED:
ca-certificates 2024.9.24-haa95532_0 --> 2024.11.26-haa95532_0
pytorch-mutex 1.0-cpu --> 1.0-cuda
The following packages will be DOWNGRADED:
torchaudio 2.5.1-py310_cpu --> 2.5.0-py310_cu118
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(yolov8) D:\Miniconda3\envs\yolov8>
(base) D:\code\ultralytics-main>conda activate yolov8
(yolov8) D:\code\ultralytics-main>
(yolov8) D:\code\ultralytics-main>pip show ultralytics
Name: ultralytics
Version: 8.3.36
(yolov8) D:\code\ultralytics-main>nvidia-smi
Fri Dec 6 10:44:32 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 551.61 Driver Version: 551.61 CUDA Version: 12.4 |
-------------------------------最新的 cpu 没有gpu
(new) D:\code\ultralytics-main>
(new) D:\code\ultralytics-main>pip show torch
Name: torch
Version: 2.5.1
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3-Clause
Location: d:\miniconda3\envs\new\lib\site-packages
Requires: filelock, fsspec, jinja2, networkx, sympy, typing-extensions
Required-by: torchaudio, torchvision, ultralytics, ultralytics-thop
(new) D:\code\ultralytics-main>pip show ultralytics
Name: ultralytics
Version: 8.3.44
Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
Home-page: https://ultralytics.com
Author:
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
License: AGPL-3.0
Location: d:\miniconda3\envs\new\lib\site-packages
Requires: matplotlib, numpy, opencv-python, pandas, pillow, psutil, py-cpuinfo, pyyaml, requests, scipy, seaborn, torch, torchvision, tqdm, ultralytics-thop
Required-by:
(new) D:\code\ultralytics-main>pip show torchvision
Name: torchvision
Version: 0.20.1
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Author: PyTorch Core Team
Author-email: soumith@pytorch.org
License: BSD
Location: d:\miniconda3\envs\new\lib\site-packages
Requires: numpy, pillow, torch
Required-by: ultralytics
(new) D:\code\ultralytics-main>pip show torchaudio
Name: torchaudio
Version: 2.5.1
Summary: An audio package for PyTorch
Home-page: https://github.com/pytorch/audio
Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaoheng Ni, Xiaohui Zhang
Author-email: soumith@pytorch.org
License:
Location: d:\miniconda3\envs\new\lib\site-packages
Requires: torch
Required-by:
(new) D:\code\ultralytics-main>
8.3 创建新的 Conda 环境(推荐)
如果上述方法无法解决问题,建议创建一个全新的 Conda 环境,确保包的干净安装:
bash
复制代码
# 创建一个新的环境,命名为 yolov8_cpu,使用 Python 3.10 conda create -n yolov8_cpu python=3.10 # 激活新环境 conda activate yolov8_cpu # 升级 pip python -m pip install --upgrade pip # 安装必要的库 pip install torch torchvision torchaudio ultralytics matplotlib numpy opencv-python pandas pillow pyyaml scipy seaborn # 安装可选的库 pip install tensorboard albumentations scikit-learn