YOLOv8 的安装与训练

YOLOv8 是 YOLO 系列实时目标检测器中的较新迭代版本,在准确性和速度方面提供了前沿性能。基于之前 YOLO 版本的进步,YOLOv8 引入了新的特性和优化,使其成为各种应用中各种目标检测任务的理想选择。

一、安装显卡驱动与CUDA:

这个系统已经安装好了显卡驱动与CUDA 11.8。

查看一下CUDA 的版本:

ai@jupyter:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

二、安装 YOLOv8:

ai@jupyter:~$ git clone https://github.com/ultralytics/ultralytics.git

Cloning into 'ultralytics'...
remote: Enumerating objects: 40899, done.
remote: Counting objects: 100% (1546/1546), done.
remote: Compressing objects: 100% (882/882), done.
remote: Total 40899 (delta 1026), reused 1058 (delta 659), pack-reused 39353 (from 1)
Receiving objects: 100% (40899/40899), 31.48 MiB | 12.85 MiB/s, done.
Resolving deltas: 100% (30115/30115), done.

ai@jupyter:~$ pip install ultralytics

ai@jupyter:~$ pip install ultralytics
Looking in indexes: https://mirror.baidu.com/pypi/simple/, https://mirrors.aliyun.com/pypi/simple/
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/ultralytics/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting ultralyticsDownloading https://mirrors.aliyun.com/pypi/packages/60/b0/6b910499e15fdc7159acfa395f343a8c1138f3a7a7a14848abf131ef9b51/ultralytics-8.2.92-py3-none-any.whl (871 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 871.9/871.9 kB 10.9 MB/s eta 0:00:00
Requirement already satisfied: numpy<2.0.0,>=1.23.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (1.26.4)
Requirement already satisfied: matplotlib>=3.3.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (3.8.4)
Requirement already satisfied: opencv-python>=4.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (4.9.0.80)
Requirement already satisfied: pillow>=7.1.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (10.3.0)
Requirement already satisfied: pyyaml>=5.3.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (6.0.1)
Requirement already satisfied: requests>=2.23.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (2.31.0)
Requirement already satisfied: scipy>=1.4.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (1.13.0)
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/torch/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting torch>=1.8.0 (from ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/41/05/d540049b1832d1062510efc6829634b7fbef5394c757d8312414fb65a3cb/torch-2.4.1-cp310-cp310-manylinux1_x86_64.whl (797.1 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 797.1/797.1 MB 1.4 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/torchvision/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting torchvision>=0.9.0 (from ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/72/55/e0b3821c5595a9a2c8ec98d234b4a0d1142d91daac61f007503d3158f857/torchvision-0.19.1-cp310-cp310-manylinux1_x86_64.whl (7.0 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.0/7.0 MB 17.8 MB/s eta 0:00:00
Requirement already satisfied: tqdm>=4.64.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (4.66.2)
Requirement already satisfied: psutil in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (5.9.8)
Collecting py-cpuinfo (from ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/e0/a9/023730ba63db1e494a271cb018dcd361bd2c917ba7004c3e49d5daf795a2/py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)
Requirement already satisfied: pandas>=1.1.4 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from ultralytics) (2.2.2)
Collecting seaborn>=0.11.0 (from ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/83/11/00d3c3dfc25ad54e731d91449895a79e4bf2384dc3ac01809010ba88f6d5/seaborn-0.13.2-py3-none-any.whl (294 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294.9/294.9 kB 32.7 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/ultralytics-thop/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting ultralytics-thop>=2.0.0 (from ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/12/3d/36ab0be2d46443a591979e4e1a025f18af43ffa07fb244fb5c7a07e82567/ultralytics_thop-2.0.6-py3-none-any.whl (26 kB)
Requirement already satisfied: contourpy>=1.0.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (1.2.1)
Requirement already satisfied: cycler>=0.10 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (4.51.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (1.4.5)
Requirement already satisfied: packaging>=20.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (24.0)
Requirement already satisfied: pyparsing>=2.3.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (3.1.2)
Requirement already satisfied: python-dateutil>=2.7 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics) (2024.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics) (2024.2.2)
Requirement already satisfied: filelock in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics) (3.13.4)
Requirement already satisfied: typing-extensions>=4.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics) (4.11.0)
Requirement already satisfied: sympy in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics) (1.12)
Collecting networkx (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/38/e9/5f72929373e1a0e8d142a130f3f97e6ff920070f87f91c4e13e40e0fba5a/networkx-3.3-py3-none-any.whl (1.7 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 19.4 MB/s eta 0:00:00
Requirement already satisfied: jinja2 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics) (3.1.3)
Requirement already satisfied: fsspec in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics) (2024.3.1)
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cuda-nvrtc-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cuda-nvrtc-cu12==12.1.105 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/b6/9f/c64c03f49d6fbc56196664d05dba14e3a561038a81a638eeb47f4d4cfd48/nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.7/23.7 MB 15.3 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cuda-runtime-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cuda-runtime-cu12==12.1.105 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/eb/d5/c68b1d2cdfcc59e72e8a5949a37ddb22ae6cade80cd4a57a84d4c8b55472/nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 823.6/823.6 kB 22.0 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cuda-cupti-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cuda-cupti-cu12==12.1.105 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/7e/00/6b218edd739ecfc60524e585ba8e6b00554dd908de2c9c66c1af3e44e18d/nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.1/14.1 MB 18.4 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cudnn-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cudnn-cu12==9.1.0.70 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/9f/fd/713452cd72343f682b1c7b9321e23829f00b842ceaedcda96e742ea0b0b3/nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl (664.8 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 664.8/664.8 MB 1.7 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cublas-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cublas-cu12==12.1.3.1 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/37/6d/121efd7382d5b0284239f4ab1fc1590d86d34ed4a4a2fdb13b30ca8e5740/nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 410.6/410.6 MB 2.3 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cufft-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cufft-cu12==11.0.2.54 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/86/94/eb540db023ce1d162e7bea9f8f5aa781d57c65aed513c33ee9a5123ead4d/nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.6/121.6 MB 7.6 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-curand-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-curand-cu12==10.3.2.106 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/44/31/4890b1c9abc496303412947fc7dcea3d14861720642b49e8ceed89636705/nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.5/56.5 MB 11.8 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cusolver-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cusolver-cu12==11.4.5.107 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/bc/1d/8de1e5c67099015c834315e333911273a8c6aaba78923dd1d1e25fc5f217/nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.2/124.2 MB 7.4 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-cusparse-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-cusparse-cu12==12.1.0.106 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/65/5b/cfaeebf25cd9fdec14338ccb16f6b2c4c7fa9163aefcf057d86b9cc248bb/nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 196.0/196.0 MB 5.0 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-nccl-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-nccl-cu12==2.20.5 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/4b/2a/0a131f572aa09f741c30ccd45a8e56316e8be8dfc7bc19bf0ab7cfef7b19/nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl (176.2 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 176.2/176.2 MB 5.6 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-nvtx-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-nvtx-cu12==12.1.105 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/da/d3/8057f0587683ed2fcd4dbfbdfdfa807b9160b809976099d36b8f60d08f03/nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.1/99.1 kB 15.1 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/triton/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting triton==3.0.0 (from torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/45/27/14cc3101409b9b4b9241d2ba7deaa93535a217a211c86c4cc7151fb12181/triton-3.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (209.4 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 209.4/209.4 MB 5.3 MB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/nvidia-nvjitlink-cu12/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
Collecting nvidia-nvjitlink-cu12 (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.8.0->ultralytics)Downloading https://mirrors.aliyun.com/pypi/packages/a8/48/a9775d377cb95585fb188b469387f58ba6738e268de22eae2ad4cedb2c41/nvidia_nvjitlink_cu12-12.6.68-py3-none-manylinux2014_x86_64.whl (19.7 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.7/19.7 MB 16.6 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib>=3.3.0->ultralytics) (1.16.0)
Requirement already satisfied: MarkupSafe>=2.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from jinja2->torch>=1.8.0->ultralytics) (2.1.5)
Requirement already satisfied: mpmath>=0.19 in /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages (from sympy->torch>=1.8.0->ultralytics) (1.3.0)
Installing collected packages: py-cpuinfo, triton, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, networkx, nvidia-cusparse-cu12, nvidia-cudnn-cu12, seaborn, nvidia-cusolver-cu12, torch, ultralytics-thop, torchvision, ultralytics
Successfully installed networkx-3.3 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-9.1.0.70 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.6.68 nvidia-nvtx-cu12-12.1.105 py-cpuinfo-9.0.0 seaborn-0.13.2 torch-2.4.1 torchvision-0.19.1 triton-3.0.0 ultralytics-8.2.92 ultralytics-thop-2.0.6
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/pip/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html

查看一下 PyTorch 的版本: 

ai@jupyter:~$ pip show torch
Name: torch
Version: 2.4.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
Location: /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-nccl-cu12, nvidia-nvtx-cu12, sympy, triton, typing-extensions
Required-by: torchvision, ultralytics, ultralytics-thop

用 Python 查看一下 PyTorch 的版本: 

ai@jupyter:~$ python
Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import torch
>>> print(torch.__version__)
2.4.1+cu121

>>> exit()

ai@jupyter:~$ yolo cfg
Printing '/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/ultralytics/cfg/default.yaml'

task: detect
mode: train
model: null
data: null
epochs: 100
time: null
patience: 100
batch: 16
imgsz: 640
save: true
save_period: -1
cache: false
device: null
workers: 8
project: null
name: null
exist_ok: false
pretrained: true
optimizer: auto
verbose: true
seed: 0
deterministic: true
single_cls: false
rect: false
cos_lr: false
close_mosaic: 10
resume: false
amp: true
fraction: 1.0
profile: false
freeze: None
multi_scale: false
overlap_mask: true
mask_ratio: 4
dropout: 0.0
val: true
split: val
save_json: false
save_hybrid: false
conf: null
iou: 0.7
max_det: 300
half: false
dnn: false
plots: true
source: null
vid_stride: 1
stream_buffer: false
visualize: false
augment: false
agnostic_nms: false
classes: null
retina_masks: false
embed: null
show: false
save_frames: false
save_txt: false
save_conf: false
save_crop: false
show_labels: true
show_conf: true
show_boxes: true
line_width: null
format: torchscript
keras: false
optimize: false
int8: false
dynamic: false
simplify: false
opset: null
workspace: 4
nms: false
lr0: 0.01
lrf: 0.01
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 7.5
cls: 0.5
dfl: 1.5
pose: 12.0
kobj: 1.0
label_smoothing: 0.0
nbs: 64
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.0
perspective: 0.0
flipud: 0.0
fliplr: 0.5
bgr: 0.0
mosaic: 1.0
mixup: 0.0
copy_paste: 0.0
auto_augment: randaugment
erasing: 0.4
crop_fraction: 1.0
cfg: null
tracker: botsort.yaml

三、训练模型:

以 coco128 为例:(自动下载数据集及模型,需要联网)

ai@jupyter:~$ yolo detect train data=coco128.yaml model=yolov8n.pt epochs=100 imgsz=640
Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt to 'yolov8n.pt'...

如果本地没有 yolov8n.pt 文件,会直接从 github 上下载,长时间如果下载不下来,可以先手动下载到本地。
ai@jupyter:~$ yolo detect train data=coco128.yaml model=yolov8n.pt epochs=100 imgsz=640

Ultralytics YOLOv8.2.92 🚀 Python-3.10.10 torch-2.4.1+cu121 CUDA:0 (Tesla V100-SXM2-32GB, 16384MiB)
engine/trainer: task=detect, mode=train, model=yolov8n.pt, data=coco128.yaml, epochs=100, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/trainDataset 'coco128.yaml' images not found ⚠️, missing path '/home/aistudio/datasets/coco128/images/train2017'
Downloading https://ultralytics.com/assets/coco128.zip to '/home/aistudio/datasets/coco128.zip'...2%|██▍                                                                                                                               | 128k/6.66M [00:30<11:33, 9.88kB/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.66M/6.66M [01:09<00:00, 100kB/s]
Unzipping /home/aistudio/datasets/coco128.zip to /home/aistudio/datasets/coco128...: 100%|██████████| 263/263 [00:00<00:00, 2433.26file/s]
Dataset download success ✅ (75.3s), saved to /home/aistudio/datasetsDownloading https://ultralytics.com/assets/Arial.ttf to '/home/aistudio/.config/Ultralytics/Arial.ttf'...0%|                                                                                                                                           | 0.00/755k [00:00<?, ?B/s]68%|████████████████████████████████████████████████████████████████████████████████████████▊                                          | 512k/755k [01:03<00:29, 8.44kB/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 755k/755k [01:35<00:00, 8.11kB/s]from  n    params  module                                       arguments                     0                  -1  1       464  ultralytics.nn.modules.conv.Conv             [3, 16, 3, 2]                 1                  -1  1      4672  ultralytics.nn.modules.conv.Conv             [16, 32, 3, 2]                2                  -1  1      7360  ultralytics.nn.modules.block.C2f             [32, 32, 1, True]             3                  -1  1     18560  ultralytics.nn.modules.conv.Conv             [32, 64, 3, 2]                4                  -1  2     49664  ultralytics.nn.modules.block.C2f             [64, 64, 2, True]             5                  -1  1     73984  ultralytics.nn.modules.conv.Conv             [64, 128, 3, 2]               6                  -1  2    197632  ultralytics.nn.modules.block.C2f             [128, 128, 2, True]           7                  -1  1    295424  ultralytics.nn.modules.conv.Conv             [128, 256, 3, 2]              8                  -1  1    460288  ultralytics.nn.modules.block.C2f             [256, 256, 1, True]           9                  -1  1    164608  ultralytics.nn.modules.block.SPPF            [256, 256, 5]                 10                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']          11             [-1, 6]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           12                  -1  1    148224  ultralytics.nn.modules.block.C2f             [384, 128, 1]                 13                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']          14             [-1, 4]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           15                  -1  1     37248  ultralytics.nn.modules.block.C2f             [192, 64, 1]                  16                  -1  1     36992  ultralytics.nn.modules.conv.Conv             [64, 64, 3, 2]                17            [-1, 12]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           18                  -1  1    123648  ultralytics.nn.modules.block.C2f             [192, 128, 1]                 19                  -1  1    147712  ultralytics.nn.modules.conv.Conv             [128, 128, 3, 2]              20             [-1, 9]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           21                  -1  1    493056  ultralytics.nn.modules.block.C2f             [384, 256, 1]                 22        [15, 18, 21]  1    897664  ultralytics.nn.modules.head.Detect           [80, [64, 128, 256]]          
Model summary: 225 layers, 3,157,200 parameters, 3,157,184 gradients, 8.9 GFLOPsTransferred 355/355 items from pretrained weights
Freezing layer 'model.22.dfl.conv.weight'
AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n...
AMP: checks passed ✅
train: Scanning /home/aistudio/datasets/coco128/labels/train2017... 126 images, 2 backgrounds, 0 corrupt: 100%|██████████| 128/128 [00:00<00:00, 491.28it/s]
train: New cache created: /home/aistudio/datasets/coco128/labels/train2017.cache
val: Scanning /home/aistudio/datasets/coco128/labels/train2017.cache... 126 images, 2 backgrounds, 0 corrupt: 100%|██████████| 128/128 [00:00<?, ?it/s]
Plotting labels to runs/detect/train/labels.jpg...
optimizer: 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically...
optimizer: AdamW(lr=0.000119, momentum=0.9) with parameter groups 57 weight(decay=0.0), 64 weight(decay=0.0005), 63 bias(decay=0.0)
Image sizes 640 train, 640 val
Using 8 dataloader workers
Logging results to runs/detect/train
Starting training for 100 epochs...Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size1/100      2.69G      1.214      1.669       1.27        217        640: 100%|██████████| 8/8 [00:04<00:00,  1.60it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:03<00:00,  1.16it/s]all        128        929       0.65      0.516      0.611      0.453Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size2/100      2.56G        1.2      1.434      1.229        218        640: 100%|██████████| 8/8 [00:03<00:00,  2.55it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:01<00:00,  2.35it/s]all        128        929      0.656      0.545      0.624      0.466Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size3/100      2.89G      1.155      1.372      1.251        215        640: 100%|██████████| 8/8 [00:02<00:00,  2.94it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:01<00:00,  2.21it/s]all        128        929      0.679      0.546      0.635      0.47297/100      2.49G     0.8143     0.6814      0.997         97        640: 100%|██████████| 8/8 [00:02<00:00,  3.33it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:01<00:00,  2.57it/s]all        128        929      0.889      0.809      0.874      0.724Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size98/100      2.56G      0.808     0.6858     0.9922        117        640: 100%|██████████| 8/8 [00:02<00:00,  3.14it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:01<00:00,  2.29it/s]all        128        929      0.888      0.807      0.874      0.724Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size99/100      2.55G     0.8293     0.6906     0.9987         72        640: 100%|██████████| 8/8 [00:02<00:00,  3.10it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:01<00:00,  2.18it/s]all        128        929      0.892      0.804      0.872      0.723Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size100/100      2.49G     0.8595     0.7396      1.023         75        640: 100%|██████████| 8/8 [00:02<00:00,  3.15it/s]Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:01<00:00,  2.30it/s]all        128        929       0.89      0.805      0.871      0.723100 epochs completed in 0.153 hours.
Optimizer stripped from runs/detect/train/weights/last.pt, 6.5MB
Optimizer stripped from runs/detect/train/weights/best.pt, 6.5MBValidating runs/detect/train/weights/best.pt...
Ultralytics YOLOv8.2.92 🚀 Python-3.10.10 torch-2.4.1+cu121 CUDA:0 (Tesla V100-SXM2-32GB, 16384MiB)
Model summary (fused): 168 layers, 3,151,904 parameters, 0 gradients, 8.7 GFLOPsClass     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 4/4 [00:04<00:00,  1.02s/it]all        128        929      0.927      0.802      0.884      0.743person         61        254      0.983      0.696      0.881      0.702bicycle          3          6      0.869        0.5      0.616      0.476car         12         46      0.928      0.281      0.597      0.337motorcycle          4          5      0.939          1      0.995      0.964airplane          5          6      0.953          1      0.995      0.964bus          5          7          1      0.773      0.978      0.845train          3          3      0.936          1      0.995      0.764truck          5         12      0.937        0.5       0.62      0.488boat          2          6      0.758      0.526      0.789      0.627traffic light          4         14          1      0.298      0.433      0.273stop sign          2          2       0.89          1      0.995      0.895bench          5          9          1      0.828      0.975      0.799bird          2         16          1      0.962      0.995      0.808cat          4          4      0.928          1      0.995       0.95dog          9          9      0.993          1      0.995      0.884horse          1          2      0.892          1      0.995      0.897elephant          4         17          1       0.93      0.985      0.877bear          1          1      0.813          1      0.995      0.995zebra          2          4      0.931          1      0.995      0.995giraffe          4          9      0.999          1      0.995      0.913backpack          4          6      0.952      0.667      0.834      0.691umbrella          4         18      0.945       0.96      0.992      0.825handbag          9         19          1      0.494      0.757      0.506tie          6          7      0.938      0.857      0.861      0.762suitcase          2          4          1      0.935      0.995      0.809frisbee          5          5      0.905        0.8      0.802      0.742skis          1          1      0.865          1      0.995      0.895snowboard          2          7      0.854      0.837      0.944      0.752sports ball          6          6          1      0.555      0.673      0.397kite          2         10          1      0.275      0.802      0.341baseball bat          4          4      0.734        0.5      0.825      0.476baseball glove          4          7      0.986      0.429      0.439      0.381skateboard          3          5          1      0.798       0.84      0.648tennis racket          5          7          1       0.66      0.718      0.498bottle          6         18          1      0.477      0.835      0.577wine glass          5         16      0.902      0.438      0.806      0.568cup         10         36      0.992      0.667      0.898      0.674fork          6          6       0.94      0.833      0.872      0.704knife          7         16       0.85      0.625      0.824      0.549spoon          5         22      0.939      0.698      0.775      0.603bowl          9         28      0.959      0.826        0.9      0.762banana          1          1      0.792          1      0.995      0.995sandwich          2          2      0.876          1      0.995      0.995orange          1          4      0.789          1      0.995      0.798broccoli          4         11      0.834      0.364      0.544      0.412carrot          3         24      0.955      0.876      0.965      0.702hot dog          1          2      0.871          1      0.995      0.995pizza          5          5      0.942          1      0.995      0.958donut          2         14      0.916          1      0.995      0.938cake          4          4      0.927          1      0.995       0.96chair          9         35       0.96      0.685      0.892      0.683couch          5          6          1      0.884      0.995      0.828potted plant          9         14      0.935      0.857      0.978      0.852bed          3          3      0.912          1      0.995      0.995dining table         10         13      0.986          1      0.995      0.879toilet          2          2      0.869          1      0.995      0.848tv          2          2       0.88          1      0.995      0.946laptop          2          3      0.912          1      0.995      0.908mouse          2          2      0.759        0.5      0.504      0.403remote          5          8      0.954       0.75      0.751      0.656cell phone          5          8          1       0.58      0.653      0.442microwave          3          3      0.971          1      0.995      0.901oven          5          5      0.755      0.618      0.722      0.588sink          4          6      0.977          1      0.995      0.788refrigerator          5          5       0.93          1      0.995      0.977book          6         29      0.967      0.448      0.709      0.509clock          8          9      0.958      0.889      0.961      0.856vase          2          2       0.86          1      0.995      0.895scissors          1          1      0.805          1      0.995      0.697teddy bear          6         21          1      0.851      0.958      0.797toothbrush          2          5       0.99          1      0.995      0.929
Speed: 0.2ms preprocess, 3.1ms inference, 0.0ms loss, 5.2ms postprocess per image
Results saved to runs/detect/train
💡 Learn more at https://docs.ultralytics.com/modes/train

训练完的最好模型为:/home/aistudio/runs/detect/train/weights/best.pt

训练过程保存为:runs/detect/train/results.png,如下图:

 四、推理验证:

  • 使用经典的图片验证:

直接使用网上的图片作为测试:source='https://ultralytics.com/images/bus.jpg',或者先下载到本地。

ai@jupyter:~$ yolo detect predict model=runs/detect/train/weights/best.pt source=bus.jpg

Ultralytics YOLOv8.2.92 🚀 Python-3.10.10 torch-2.4.1+cu121 CUDA:0 (Tesla V100-SXM2-32GB, 16384MiB)
Model summary (fused): 168 layers, 3,151,904 parameters, 0 gradients, 8.7 GFLOPs

image 1/1 /home/aistudio/bus.jpg: 640x480 3 persons, 1 bus, 1 stop sign, 39.6ms
Speed: 7.0ms preprocess, 39.6ms inference, 2.4ms postprocess per image at shape (1, 3, 640, 480)
Results saved to runs/detect/predict
💡 Learn more at https://docs.ultralytics.com/modes/predict

  • 换一张图片测试:

ai@jupyter:~$ yolo detect predict model=runs/detect/train/weights/best.pt source=030.jpg
Ultralytics YOLOv8.2.92 🚀 Python-3.10.10 torch-2.4.1+cu121 CUDA:0 (Tesla V100-SXM2-32GB, 16384MiB)
Model summary (fused): 168 layers, 3,151,904 parameters, 0 gradients, 8.7 GFLOPs

image 1/1 /home/aistudio/030.jpg: 448x640 1 potted plant, 1 vase, 139.9ms
Speed: 7.6ms preprocess, 139.9ms inference, 2.5ms postprocess per image at shape (1, 3, 448, 640)
Results saved to runs/detect/predict2
💡 Learn more at https://docs.ultralytics.com/modes/predict

五、导出(Export)

将 训练好的模型导出为不同的格式,如 ONNX、CoreML 等。

yolo export model=runs/detect/train/weights/best.pt format=onnx

 小结:

YOLOv8 在多个领域中表现出色,特别是在需要高精度和高速度的实时检测任务中,如无人驾驶、智能监控和工业检测等。这些应用场景对目标检测的实时性和准确性有着极高的要求,而 YOLOv8 正是满足这些需求的理想选择。

综上所述,YOLOv8 通过模型结构改进、数据增强和训练策略优化、多尺度检测和轻量化以及提供多种模型变体等新特性和优化措施,进一步提升了目标检测的精度和速度,并扩展了其应用场景。

                                                                                         老徐,仲秋,2024/9/17

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1537354.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

aspcms 获取webshell漏洞复现

1.通过访问/admin_aspcms/login.asp来到后台 使用admin 123456 登录 2.点击扩展功能-幻灯片设置-保存&#xff0c;同时进行抓包 3.修改数据包中的slideTextStatus字段&#xff0c;将其更改为 1%25><%25Eval(Request (chr(65)))%25><%25 密码为a 4.访问木马的地…

可靠性:MSTP 和 VRRP 配置实验

一、拓扑&#xff1a; 说明&#xff1a; 1、交换机 SW1、2、3 分别起 vlan 10、20&#xff0c;都以 trunk 方式连接 2、 PC1、2 分别属于 vlan 10、20 3、SW1、2 起 vlan 100 做为管理段&#xff0c;网关地址分别以 100.1.1.1/24 和 200.1.1.2/24 和 AR1相连 …

【日记】对这两天的总结,比赛止步 32 强(3338 字)

正文 这两天的事情非常多&#xff0c;一直也没来得及写。 这篇日记相当于对这几天的一个大总结吧。 2024 年 9 月 13 日 - 14 日 这两天都在培训&#xff0c;所幸最终考核卷子&#xff0c;题目出得不是很难。只给半个小时考试。我的天啊&#xff0c;我题目都没写完。 我印象中出…

即时通讯平台是什么?

即时通讯平台是一种软件或服务&#xff0c;用于提供实时的多媒体沟通和交流功能。它允许用户在任何时间、任何地点&#xff0c;通过文本、语音、图片、视频等方式与其他用户进行实时的双向交流。即时通讯平台在个人和企业间广泛应用&#xff0c;为用户提供了高效便捷的沟通工具…

虚拟机centos_7 配置教程(镜像源、配置centos、静态ip地址、Finalshell远程操控使用)

文章目录 一、下载镜像源&#xff08;准备工作&#xff09;1、开源网站2、下载 二、VMware配置centos三、配置静态IP地址四、Finalshell使用1、下载Finalshell2、连接虚拟机 五、谢谢观看&#xff01; 一、下载镜像源&#xff08;准备工作&#xff09; 1、开源网站 有许多开源…

[DDCTF2018](╯°□°)╯︵ ┻━┻

贴个脚本在这 def split_and_convert(input_string):# 检查字符串长度是否为偶数if len(input_string) % 2 ! 0:print("字符串长度不是偶数&#xff0c;最后一个字符将被丢弃。")input_string input_string[:-1] # 丢弃最后一个字符# 使用列表推导式将字符串分隔为…

中位数贪心+分组,CF 433C - Ryouko‘s Memory Note

目录 一、题目 1、题目描述 2、输入输出 2.1输入 2.2输出 3、原题链接 二、解题报告 1、思路分析 2、复杂度 3、代码详解 一、题目 1、题目描述 2、输入输出 2.1输入 2.2输出 3、原题链接 433C - Ryoukos Memory Note 二、解题报告 1、思路分析 改变 x 只会影响…

47.面向对象综合训练-汽车

//题目需求&#xff1a;定义数组存储3个汽车对象 //汽车的属性&#xff1a;品牌&#xff0c;价格&#xff0c;颜色 //创建三个汽车对象&#xff0c;数据通过键盘录入而来&#xff0c;并把数据存入到数组当中 1.标准的JavaBean类 public class Car {private String brand;//品…

Ubuntu使用docker安装Oracle23aiFree

Oracle 安装docker安装部署 官网&#xff1a;Oracle23AI 功能亮点 AI战略搜索 Oracle AI Vector Search专为人工智能&#xff08;AI&#xff09;工作负载而设计&#xff0c;允许您基于语义而不是关键字查询数据。 JSON 关系二元性 数据可以作为 JSON 文档或关系表透明地访问和…

『功能项目』第二职业法师的平A【57】

我们打开上一篇56制作提示主角升级面板的项目&#xff0c; 本章要做的事情是制作法师平A的魔法球触碰到Boss后让Boss受到一个无视攻击力与防御力的一个&#xff08;100&#xff09;左右随机的一个伤害值 修改脚本&#xff1a;PlayerCtrl.cs 将法师职业生成的魔法球的标签Tag设…

2019-2023(CSP-J)选择题真题解析

1&#xff0c;了解的知识 中国的国家顶级域名是&#xff08; &#xff09;【2019年CSP-J初赛选择题第一题】 A…cn B…ch C…chn D…china 【答案】&#xff1a;A 以下哪个奖项是计算机科学领域的最高奖&#xff1f;&#xff08; &#xff09;【2019年CSP-J初赛选择题第…

项目实训:CSS基本布局理解——WEB开发系列38

对CSS学习已经接近尾声&#xff0c;下面你可以对以下两道“小卡拉米”测试进行测试下CSS理解程度。 题 1&#xff1a;基于栅格布局的现代博客首页设计 题目要求&#xff1a; 创建一个博客首页布局&#xff0c;包含一个顶部导航栏、一个主要的内容区域&#xff08;左侧为博客文…

PumpkinRaising靶机详解

靶机下载地址 https://www.vulnhub.com/entry/mission-pumpkin-v10-pumpkinraising,324/ 靶机配置 端口扫描 nmap -sV -A -T4 192.168.229.162 访问网页 http://192.168.229.162/ 查看页面源码 base64解密 发现base64解码后的信息不重要 发现一个html网页&#xff0c;访问 …

【C++】C++的多态

目录 多态的使用 多态的概念 多态的定义和实现 虚函数 构成多态的条件 特殊情况&#xff1a;协变 析构函数的重写 怎么实现 为什么实现 override和final关键字 override final 重载/重写/隐藏的对比 纯虚函数和抽象类 纯虚函数 抽象类 多态的实现 虚函数表指针…

【C++】vector详解,模拟实现

目录 1. vector的介绍 2. vector的使用 2.1 构造函数 2.2 遍历方式 2.3 reserve与resize 2.4 shrink_to_fit 2.5 insert&#xff0c;erase&#xff0c;find 3. vector模拟实现 3.1 初始结构 3.2 析构函数 3.3 获取容量和元素个数 3.4 扩容reserve 3.5 resize改变…

方法引用(Java)

把已经有的方法拿过来用&#xff0c;当做函数式接口中抽象方法的方法体 1.引用处必须是函数式接口 2.被引用的方法必须已经存在 3.被引用的方法形参的返回值需要跟抽象方法保持一致 4.被引用方法的功能要满足当前需求 package function;import java.util.Arrays;public cl…

C++基础(3)——类和对象(中)

目录 1.类的默认成员函数 ​编辑 2. 构造函数 3. 析构函数 4. 拷⻉构造函数 5. 赋值运算符重载 5.1 运算符重载 5.2 赋值运算符重载 5.3 ⽇期类实现 6. 取地址运算符重载 6.1 const成员函数 6.2 取地址运算符重载 1.类的默认成员函数 简介&#xff1a;默认成员函数就…

day21JS-axios数据通信

1. 什么是axios axios 是一个基于Promise 用于浏览器和 nodejs 的 HTTP 客户端&#xff0c;简单的理解就是ajax的封装&#xff0c;只不过它是Promise的实现版本。 特性&#xff1a; 从浏览器中创建 XMLHttpRequests从 node.js 创建 http 请求支持 Promise API拦截请求和响应转…

论文笔记:交替单模态适应的多模态表征学习

整理了CVPR2024 Multimodal Representation Learning by Alternating Unimodal Adaptation&#xff09;论文的阅读笔记 背景MLA框架实验Q1 与之前的方法相比&#xff0c;MLA能否克服模态懒惰并提高多模态学习性能?Q2 MLA在面临模式缺失的挑战时表现如何?Q3 所有模块是否可以有…

ThreadX源码:Cortex-A7的tx_thread_irq_nesting_end(嵌套中断结束动作).s汇编代码分析

0 参考资料 Cortex M3权威指南(中文).pdf&#xff08;可以参考ARM指令集用法&#xff09; 1 前言 tx_thread_irq_nesting_end.S是用来实现Cortex-A7 IRQ嵌套中断的结束函数实现的汇编文件。 2 源码分析 源码如下&#xff1a; 1.#ifdef TX_ENABLE_FIQ_SUPPORT 2.DISABLE_INT…