最新资讯

  • 【YOLOv8】YOLOv8改进系列(1)----替换主干网络之EfficientViT(CVPR2023)

【YOLOv8】YOLOv8改进系列(1)----替换主干网络之EfficientViT(CVPR2023)

2025-05-05 11:37:33 0 阅读

主页:HABUO🍁主页:HABUO

🍁如果再也不能见到你,祝你早安,午安,晚安🍁


   【YOLOv8改进系列】: 

【YOLOv8】YOLOv8结构解读

YOLOv8改进系列(1)----替换主干网络之EfficientViT 

YOLOv8改进系列(2)----替换主干网络之FasterNet

YOLOv8改进系列(3)----替换主干网络之ConvNeXt V2

YOLOv8改进系列(4)----替换C2f之FasterNet中的FasterBlock替换C2f中的Bottleneck 

YOLOv8改进系列(5)----替换主干网络之EfficientFormerV2 

YOLOv8改进系列(6)----替换主干网络之VanillaNet

YOLOv8改进系列(7)----替换主干网络之LSKNet

YOLOv8改进系列(8)----替换主干网络之Swin Transformer 

YOLOv8改进系列(9)----替换主干网络之RepViT


💯一、EfficientViT介绍 

  • 论文题目:《EfficientViT: Memory Efficient Vision Transformer with Cascaded Group Attention
  • 论文地址:EfficientViT: Memory Efficient Vision Transformer With Cascaded Group Attention
  • 源码地址:Cream/EfficientViT at main · microsoft/Cream · GitHub

 1.1 简介

EfficientViT:作者是来自香港中文大学和微软研究院的研究团队。论文的主要内容是提出了一种新型的高效视觉变换器(Vision Transformer,简称ViT)模型,这种模型旨在解决传统ViT在计算成本高、不适合实时应用的问题。

  • 问题陈述:传统的视觉变换器虽然性能出色,但计算成本高昂,不适合实时应用。

  • EfficientViT提出:作者提出了EfficientViT,这是一种高速视觉变换器,通过设计新的构建模块和注意力机制来提高内存效率和计算效率。

  • 主要贡献

    • 提出了一种新的构建模块,使用单一的内存限制的多头自注意力(MHSA)层夹在高效的前馈网络(FFN)层之间,以提高内存效率并增强通道间通信。

    • 发现注意力图在不同头之间具有高度相似性,导致计算冗余。为此,提出了级联组注意力(CGA)模块,通过向不同的头提供完整的特征的不同分割来节省计算成本并提高注意力多样性。

    • 通过在关键网络组件(如值投影)上增加通道宽度,同时缩小不太重要的组件(如FFN中的隐藏维度)来重新分配参数,从而提高模型参数效率。


1.2 网络结构

EfficientViT的网络结构包含三个主要阶段,每个阶段都堆叠了提出的EfficientViT构建模块。网络结构如上图所示,它引入了重叠的patch embedding来将16×16的图像块嵌入到具有C1维度的tokens中,这增强了模型在低级视觉表示学习中的能力。 

EfficientViT的总体架构,具体包括:

  • Overlap PatchEmbed:将16×16的图像块嵌入到具有C1维度的tokens中。

  • EfficientViT Subsample:为了实现高效的下采样,提出了EfficientViT下采样块,它也具有三明治布局,只是将自注意力层替换为倒置残差块,以减少下采样期间的信息损失。

  • BatchNorm (BN):整个模型中采用BN而不是Layer Norm (LN),因为BN可以折叠到前面的卷积或线性层中,这比LN在运行时更有优势。

  • ReLU激活函数:使用ReLU作为激活函数,因为常用的GELU或HardSwish在某些推理部署平台上支持不佳,而且速度更慢。

EfficientViT的构建模块,它由以下几个部分组成: 

  • Sandwich Layout:这种布局在FFN层之间使用单个内存受限的MHSA层,以减少由MHSA中的内存限制操作引起的时间消耗,并应用更多的FFN层以高效地允许不同特征通道之间的通信。此外,每个FFN之前还应用了一个额外的token交互层,使用深度卷积(DWConv)引入局部结构信息的归纳偏差,增强模型能力。

  • Cascaded Group Attention(CGA):为了提高计算效率,提出了一种新的注意力模块,它通过向不同的头提供完整的特征的不同分割,并在头之间级联输出特征。这种模块不仅减少了多头注意力中的计算冗余,而且通过增加网络深度来提升模型容量,而不引入任何额外的参数。

  • Parameter Reallocation(参数重新分配):为了提高参数效率,通过扩大关键网络组件(如值投影)的通道宽度,同时缩小不太重要的组件(如FFN中的隐藏维度)来重新分配参数。这种重新分配策略最终促进了模型参数效率。


 💯二、具体添加方法

第①步:创建efficeintVit.py

创建完成后,将下面代码直接复制粘贴进去:

import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
import itertools

from timm.models.layers import SqueezeExcite

import numpy as np
import itertools

__all__ = ['EfficientViT_M0', 'EfficientViT_M1', 'EfficientViT_M2', 'EfficientViT_M3', 'EfficientViT_M4', 'EfficientViT_M5']

class Conv2d_BN(torch.nn.Sequential):
    def __init__(self, a, b, ks=1, stride=1, pad=0, dilation=1,
                 groups=1, bn_weight_init=1, resolution=-10000):
        super().__init__()
        self.add_module('c', torch.nn.Conv2d(
            a, b, ks, stride, pad, dilation, groups, bias=False))
        self.add_module('bn', torch.nn.BatchNorm2d(b))
        torch.nn.init.constant_(self.bn.weight, bn_weight_init)
        torch.nn.init.constant_(self.bn.bias, 0)

    @torch.no_grad()
    def switch_to_deploy(self):
        c, bn = self._modules.values()
        w = bn.weight / (bn.running_var + bn.eps)**0.5
        w = c.weight * w[:, None, None, None]
        b = bn.bias - bn.running_mean * bn.weight / 
            (bn.running_var + bn.eps)**0.5
        m = torch.nn.Conv2d(w.size(1) * self.c.groups, w.size(
            0), w.shape[2:], stride=self.c.stride, padding=self.c.padding, dilation=self.c.dilation, groups=self.c.groups)
        m.weight.data.copy_(w)
        m.bias.data.copy_(b)
        return m

def replace_batchnorm(net):
    for child_name, child in net.named_children():
        if hasattr(child, 'fuse'):
            setattr(net, child_name, child.fuse())
        elif isinstance(child, torch.nn.BatchNorm2d):
            setattr(net, child_name, torch.nn.Identity())
        else:
            replace_batchnorm(child)
            

class PatchMerging(torch.nn.Module):
    def __init__(self, dim, out_dim, input_resolution):
        super().__init__()
        hid_dim = int(dim * 4)
        self.conv1 = Conv2d_BN(dim, hid_dim, 1, 1, 0, resolution=input_resolution)
        self.act = torch.nn.ReLU()
        self.conv2 = Conv2d_BN(hid_dim, hid_dim, 3, 2, 1, groups=hid_dim, resolution=input_resolution)
        self.se = SqueezeExcite(hid_dim, .25)
        self.conv3 = Conv2d_BN(hid_dim, out_dim, 1, 1, 0, resolution=input_resolution // 2)

    def forward(self, x):
        x = self.conv3(self.se(self.act(self.conv2(self.act(self.conv1(x))))))
        return x


class Residual(torch.nn.Module):
    def __init__(self, m, drop=0.):
        super().__init__()
        self.m = m
        self.drop = drop

    def forward(self, x):
        if self.training and self.drop > 0:
            return x + self.m(x) * torch.rand(x.size(0), 1, 1, 1,
                                              device=x.device).ge_(self.drop).div(1 - self.drop).detach()
        else:
            return x + self.m(x)


class FFN(torch.nn.Module):
    def __init__(self, ed, h, resolution):
        super().__init__()
        self.pw1 = Conv2d_BN(ed, h, resolution=resolution)
        self.act = torch.nn.ReLU()
        self.pw2 = Conv2d_BN(h, ed, bn_weight_init=0, resolution=resolution)

    def forward(self, x):
        x = self.pw2(self.act(self.pw1(x)))
        return x


class CascadedGroupAttention(torch.nn.Module):
    r""" Cascaded Group Attention.

    Args:
        dim (int): Number of input channels.
        key_dim (int): The dimension for query and key.
        num_heads (int): Number of attention heads.
        attn_ratio (int): Multiplier for the query dim for value dimension.
        resolution (int): Input resolution, correspond to the window size.
        kernels (List[int]): The kernel size of the dw conv on query.
    """
    def __init__(self, dim, key_dim, num_heads=8,
                 attn_ratio=4,
                 resolution=14,
                 kernels=[5, 5, 5, 5],):
        super().__init__()
        self.num_heads = num_heads
        self.scale = key_dim ** -0.5
        self.key_dim = key_dim
        self.d = int(attn_ratio * key_dim)
        self.attn_ratio = attn_ratio

        qkvs = []
        dws = []
        for i in range(num_heads):
            qkvs.append(Conv2d_BN(dim // (num_heads), self.key_dim * 2 + self.d, resolution=resolution))
            dws.append(Conv2d_BN(self.key_dim, self.key_dim, kernels[i], 1, kernels[i]//2, groups=self.key_dim, resolution=resolution))
        self.qkvs = torch.nn.ModuleList(qkvs)
        self.dws = torch.nn.ModuleList(dws)
        self.proj = torch.nn.Sequential(torch.nn.ReLU(), Conv2d_BN(
            self.d * num_heads, dim, bn_weight_init=0, resolution=resolution))

        points = list(itertools.product(range(resolution), range(resolution)))
        N = len(points)
        attention_offsets = {}
        idxs = []
        for p1 in points:
            for p2 in points:
                offset = (abs(p1[0] - p2[0]), abs(p1[1] - p2[1]))
                if offset not in attention_offsets:
                    attention_offsets[offset] = len(attention_offsets)
                idxs.append(attention_offsets[offset])
        self.attention_biases = torch.nn.Parameter(
            torch.zeros(num_heads, len(attention_offsets)))
        self.register_buffer('attention_bias_idxs',
                             torch.LongTensor(idxs).view(N, N))

    @torch.no_grad()
    def train(self, mode=True):
        super().train(mode)
        if mode and hasattr(self, 'ab'):
            del self.ab
        else:
            self.ab = self.attention_biases[:, self.attention_bias_idxs]

    def forward(self, x):  # x (B,C,H,W)
        B, C, H, W = x.shape
        trainingab = self.attention_biases[:, self.attention_bias_idxs]
        feats_in = x.chunk(len(self.qkvs), dim=1)
        feats_out = []
        feat = feats_in[0]
        for i, qkv in enumerate(self.qkvs):
            if i > 0: # add the previous output to the input
                feat = feat + feats_in[i]
            feat = qkv(feat)
            q, k, v = feat.view(B, -1, H, W).split([self.key_dim, self.key_dim, self.d], dim=1) # B, C/h, H, W
            q = self.dws[i](q)
            q, k, v = q.flatten(2), k.flatten(2), v.flatten(2) # B, C/h, N
            attn = (
                (q.transpose(-2, -1) @ k) * self.scale
                +
                (trainingab[i] if self.training else self.ab[i])
            )
            attn = attn.softmax(dim=-1) # BNN
            feat = (v @ attn.transpose(-2, -1)).view(B, self.d, H, W) # BCHW
            feats_out.append(feat)
        x = self.proj(torch.cat(feats_out, 1))
        return x


class LocalWindowAttention(torch.nn.Module):
    r""" Local Window Attention.

    Args:
        dim (int): Number of input channels.
        key_dim (int): The dimension for query and key.
        num_heads (int): Number of attention heads.
        attn_ratio (int): Multiplier for the query dim for value dimension.
        resolution (int): Input resolution.
        window_resolution (int): Local window resolution.
        kernels (List[int]): The kernel size of the dw conv on query.
    """
    def __init__(self, dim, key_dim, num_heads=8,
                 attn_ratio=4,
                 resolution=14,
                 window_resolution=7,
                 kernels=[5, 5, 5, 5],):
        super().__init__()
        self.dim = dim
        self.num_heads = num_heads
        self.resolution = resolution
        assert window_resolution > 0, 'window_size must be greater than 0'
        self.window_resolution = window_resolution
        
        self.attn = CascadedGroupAttention(dim, key_dim, num_heads,
                                attn_ratio=attn_ratio, 
                                resolution=window_resolution,
                                kernels=kernels,)

    def forward(self, x):
        B, C, H, W = x.shape
               
        if H <= self.window_resolution and W <= self.window_resolution:
            x = self.attn(x)
        else:
            x = x.permute(0, 2, 3, 1)
            pad_b = (self.window_resolution - H %
                     self.window_resolution) % self.window_resolution
            pad_r = (self.window_resolution - W %
                     self.window_resolution) % self.window_resolution
            padding = pad_b > 0 or pad_r > 0

            if padding:
                x = torch.nn.functional.pad(x, (0, 0, 0, pad_r, 0, pad_b))

            pH, pW = H + pad_b, W + pad_r
            nH = pH // self.window_resolution
            nW = pW // self.window_resolution
            # window partition, BHWC -> B(nHh)(nWw)C -> BnHnWhwC -> (BnHnW)hwC -> (BnHnW)Chw
            x = x.view(B, nH, self.window_resolution, nW, self.window_resolution, C).transpose(2, 3).reshape(
                B * nH * nW, self.window_resolution, self.window_resolution, C
            ).permute(0, 3, 1, 2)
            x = self.attn(x)
            # window reverse, (BnHnW)Chw -> (BnHnW)hwC -> BnHnWhwC -> B(nHh)(nWw)C -> BHWC
            x = x.permute(0, 2, 3, 1).view(B, nH, nW, self.window_resolution, self.window_resolution,
                       C).transpose(2, 3).reshape(B, pH, pW, C)

            if padding:
                x = x[:, :H, :W].contiguous()

            x = x.permute(0, 3, 1, 2)

        return x


class EfficientViTBlock(torch.nn.Module):
    """ A basic EfficientViT building block.

    Args:
        type (str): Type for token mixer. Default: 's' for self-attention.
        ed (int): Number of input channels.
        kd (int): Dimension for query and key in the token mixer.
        nh (int): Number of attention heads.
        ar (int): Multiplier for the query dim for value dimension.
        resolution (int): Input resolution.
        window_resolution (int): Local window resolution.
        kernels (List[int]): The kernel size of the dw conv on query.
    """
    def __init__(self, type,
                 ed, kd, nh=8,
                 ar=4,
                 resolution=14,
                 window_resolution=7,
                 kernels=[5, 5, 5, 5],):
        super().__init__()
            
        self.dw0 = Residual(Conv2d_BN(ed, ed, 3, 1, 1, groups=ed, bn_weight_init=0., resolution=resolution))
        self.ffn0 = Residual(FFN(ed, int(ed * 2), resolution))

        if type == 's':
            self.mixer = Residual(LocalWindowAttention(ed, kd, nh, attn_ratio=ar, 
                    resolution=resolution, window_resolution=window_resolution, kernels=kernels))
                
        self.dw1 = Residual(Conv2d_BN(ed, ed, 3, 1, 1, groups=ed, bn_weight_init=0., resolution=resolution))
        self.ffn1 = Residual(FFN(ed, int(ed * 2), resolution))

    def forward(self, x):
        return self.ffn1(self.dw1(self.mixer(self.ffn0(self.dw0(x)))))


class EfficientViT(torch.nn.Module):
    def __init__(self, img_size=400,
                 patch_size=16,
                 frozen_stages=0,
                 in_chans=3,
                 stages=['s', 's', 's'],
                 embed_dim=[64, 128, 192],
                 key_dim=[16, 16, 16],
                 depth=[1, 2, 3],
                 num_heads=[4, 4, 4],
                 window_size=[7, 7, 7],
                 kernels=[5, 5, 5, 5],
                 down_ops=[['subsample', 2], ['subsample', 2], ['']],
                 pretrained=None,
                 distillation=False,):
        super().__init__()

        resolution = img_size
        self.patch_embed = torch.nn.Sequential(Conv2d_BN(in_chans, embed_dim[0] // 8, 3, 2, 1, resolution=resolution), torch.nn.ReLU(),
                           Conv2d_BN(embed_dim[0] // 8, embed_dim[0] // 4, 3, 2, 1, resolution=resolution // 2), torch.nn.ReLU(),
                           Conv2d_BN(embed_dim[0] // 4, embed_dim[0] // 2, 3, 2, 1, resolution=resolution // 4), torch.nn.ReLU(),
                           Conv2d_BN(embed_dim[0] // 2, embed_dim[0], 3, 1, 1, resolution=resolution // 8))

        resolution = img_size // patch_size
        attn_ratio = [embed_dim[i] / (key_dim[i] * num_heads[i]) for i in range(len(embed_dim))]
        self.blocks1 = []
        self.blocks2 = []
        self.blocks3 = []
        for i, (stg, ed, kd, dpth, nh, ar, wd, do) in enumerate(
                zip(stages, embed_dim, key_dim, depth, num_heads, attn_ratio, window_size, down_ops)):
            for d in range(dpth):
                eval('self.blocks' + str(i+1)).append(EfficientViTBlock(stg, ed, kd, nh, ar, resolution, wd, kernels))
            if do[0] == 'subsample':
                #('Subsample' stride)
                blk = eval('self.blocks' + str(i+2))
                resolution_ = (resolution - 1) // do[1] + 1
                blk.append(torch.nn.Sequential(Residual(Conv2d_BN(embed_dim[i], embed_dim[i], 3, 1, 1, groups=embed_dim[i], resolution=resolution)),
                                    Residual(FFN(embed_dim[i], int(embed_dim[i] * 2), resolution)),))
                blk.append(PatchMerging(*embed_dim[i:i + 2], resolution))
                resolution = resolution_
                blk.append(torch.nn.Sequential(Residual(Conv2d_BN(embed_dim[i + 1], embed_dim[i + 1], 3, 1, 1, groups=embed_dim[i + 1], resolution=resolution)),
                                    Residual(FFN(embed_dim[i + 1], int(embed_dim[i + 1] * 2), resolution)),))
        self.blocks1 = torch.nn.Sequential(*self.blocks1)
        self.blocks2 = torch.nn.Sequential(*self.blocks2)
        self.blocks3 = torch.nn.Sequential(*self.blocks3)
        
        self.channel = [i.size(1) for i in self.forward(torch.randn(1, 3, 640, 640))]

    def forward(self, x):
        outs = []
        x = self.patch_embed(x)
        x = self.blocks1(x)
        outs.append(x)
        x = self.blocks2(x)
        outs.append(x)
        x = self.blocks3(x)
        outs.append(x)
        return outs

EfficientViT_m0 = {
        'img_size': 224,
        'patch_size': 16,
        'embed_dim': [64, 128, 192],
        'depth': [1, 2, 3],
        'num_heads': [4, 4, 4],
        'window_size': [7, 7, 7],
        'kernels': [7, 5, 3, 3],
    }

EfficientViT_m1 = {
        'img_size': 224,
        'patch_size': 16,
        'embed_dim': [128, 144, 192],
        'depth': [1, 2, 3],
        'num_heads': [2, 3, 3],
        'window_size': [7, 7, 7],
        'kernels': [7, 5, 3, 3],
    }

EfficientViT_m2 = {
        'img_size': 224,
        'patch_size': 16,
        'embed_dim': [128, 192, 224],
        'depth': [1, 2, 3],
        'num_heads': [4, 3, 2],
        'window_size': [7, 7, 7],
        'kernels': [7, 5, 3, 3],
    }

EfficientViT_m3 = {
        'img_size': 224,
        'patch_size': 16,
        'embed_dim': [128, 240, 320],
        'depth': [1, 2, 3],
        'num_heads': [4, 3, 4],
        'window_size': [7, 7, 7],
        'kernels': [5, 5, 5, 5],
    }

EfficientViT_m4 = {
        'img_size': 224,
        'patch_size': 16,
        'embed_dim': [128, 256, 384],
        'depth': [1, 2, 3],
        'num_heads': [4, 4, 4],
        'window_size': [7, 7, 7],
        'kernels': [7, 5, 3, 3],
    }

EfficientViT_m5 = {
        'img_size': 224,
        'patch_size': 16,
        'embed_dim': [192, 288, 384],
        'depth': [1, 3, 4],
        'num_heads': [3, 3, 4],
        'window_size': [7, 7, 7],
        'kernels': [7, 5, 3, 3],
    }

def EfficientViT_M0(pretrained='', frozen_stages=0, distillation=False, fuse=False, pretrained_cfg=None, model_cfg=EfficientViT_m0):
    model = EfficientViT(frozen_stages=frozen_stages, distillation=distillation, pretrained=pretrained, **model_cfg)
    if pretrained:
        model.load_state_dict(update_weight(model.state_dict(), torch.load(pretrained)['model']))
    if fuse:
        replace_batchnorm(model)
    return model

def EfficientViT_M1(pretrained='', frozen_stages=0, distillation=False, fuse=False, pretrained_cfg=None, model_cfg=EfficientViT_m1):
    model = EfficientViT(frozen_stages=frozen_stages, distillation=distillation, pretrained=pretrained, **model_cfg)
    if pretrained:
        model.load_state_dict(update_weight(model.state_dict(), torch.load(pretrained)['model']))
    if fuse:
        replace_batchnorm(model)
    return model

def EfficientViT_M2(pretrained='', frozen_stages=0, distillation=False, fuse=False, pretrained_cfg=None, model_cfg=EfficientViT_m2):
    model = EfficientViT(frozen_stages=frozen_stages, distillation=distillation, pretrained=pretrained, **model_cfg)
    if pretrained:
        model.load_state_dict(update_weight(model.state_dict(), torch.load(pretrained)['model']))
    if fuse:
        replace_batchnorm(model)
    return model

def EfficientViT_M3(pretrained='', frozen_stages=0, distillation=False, fuse=False, pretrained_cfg=None, model_cfg=EfficientViT_m3):
    model = EfficientViT(frozen_stages=frozen_stages, distillation=distillation, pretrained=pretrained, **model_cfg)
    if pretrained:
        model.load_state_dict(update_weight(model.state_dict(), torch.load(pretrained)['model']))
    if fuse:
        replace_batchnorm(model)
    return model
    
def EfficientViT_M4(pretrained='', frozen_stages=0, distillation=False, fuse=False, pretrained_cfg=None, model_cfg=EfficientViT_m4):
    model = EfficientViT(frozen_stages=frozen_stages, distillation=distillation, pretrained=pretrained, **model_cfg)
    if pretrained:
        model.load_state_dict(update_weight(model.state_dict(), torch.load(pretrained)['model']))
    if fuse:
        replace_batchnorm(model)
    return model

def EfficientViT_M5(pretrained='', frozen_stages=0, distillation=False, fuse=False, pretrained_cfg=None, model_cfg=EfficientViT_m5):
    model = EfficientViT(frozen_stages=frozen_stages, distillation=distillation, pretrained=pretrained, **model_cfg)
    if pretrained:
        model.load_state_dict(update_weight(model.state_dict(), torch.load(pretrained)['model']))
    if fuse:
        replace_batchnorm(model)
    return model

def update_weight(model_dict, weight_dict):
    idx, temp_dict = 0, {}
    for k, v in weight_dict.items():
        # k = k[9:]
        if k in model_dict.keys() and np.shape(model_dict[k]) == np.shape(v):
            temp_dict[k] = v
            idx += 1
    model_dict.update(temp_dict)
    print(f'loading weights... {idx}/{len(model_dict)} items')
    return model_dict

if __name__ == '__main__':
    model = EfficientViT_M0('efficientvit_m0.pth')
    inputs = torch.randn((1, 3, 640, 640))
    res = model(inputs)
    for i in res:
        print(i.size())

创建了6个尺寸大小,分别是:(以EfficientViT_M0替换为例) 

'YOLOv8_EfficientViT_M0', 
'YOLOv8_EfficientViT_M1', 
'YOLOv8_EfficientViT_M2', 
'YOLOv8_EfficientViT_M3',
'YOLOv8_EfficientViT_M4',
'YOLOv8_EfficientViT_M5'

第②步:修改task.py 

 (1) 引入创建的efficientViT文件

from ultralytics.nn.backbone.efficientViT import *

(2)修改_predict_once函数

可直接将下述代码替换对应位置

    def _predict_once(self, x, profile=False, visualize=False, embed=None):
        """
        Perform a forward pass through the network.

        Args:
            x (torch.Tensor): The input tensor to the model.
            profile (bool):  Print the computation time of each layer if True, defaults to False.
            visualize (bool): Save the feature maps of the model if True, defaults to False.
            embed (list, optional): A list of feature vectors/embeddings to return.

        Returns:
            (torch.Tensor): The last output of the model.
        """
        y, dt, embeddings = [], [], []  # outputs
        for idx, m in enumerate(self.model):
            if m.f != -1:  # if not from previous layer
                x = y[m.f] if isinstance(m.f, int) else [x if j == -1 else y[j] for j in m.f]  # from earlier layers
            if profile:
                self._profile_one_layer(m, x, dt)
            if hasattr(m, 'backbone'):
                x = m(x)
                for _ in range(5 - len(x)):
                    x.insert(0, None)
                for i_idx, i in enumerate(x):
                    if i_idx in self.save:
                        y.append(i)
                    else:
                        y.append(None)
                # print(f'layer id:{idx:>2} {m.type:>50} output shape:{", ".join([str(x_.size()) for x_ in x if x_ is not None])}')
                x = x[-1]
            else:
                x = m(x)  # run
                y.append(x if m.i in self.save else None)  # save output
            
            # if type(x) in {list, tuple}:
            #     if idx == (len(self.model) - 1):
            #         if type(x[1]) is dict:
            #             print(f'layer id:{idx:>2} {m.type:>50} output shape:{", ".join([str(x_.size()) for x_ in x[1]["one2one"]])}')
            #         else:
            #             print(f'layer id:{idx:>2} {m.type:>50} output shape:{", ".join([str(x_.size()) for x_ in x[1]])}')
            #     else:
            #         print(f'layer id:{idx:>2} {m.type:>50} output shape:{", ".join([str(x_.size()) for x_ in x if x_ is not None])}')
            # elif type(x) is dict:
            #     print(f'layer id:{idx:>2} {m.type:>50} output shape:{", ".join([str(x_.size()) for x_ in x["one2one"]])}')
            # else:
            #     if not hasattr(m, 'backbone'):
            #         print(f'layer id:{idx:>2} {m.type:>50} output shape:{x.size()}')
            
            if visualize:
                feature_visualization(x, m.type, m.i, save_dir=visualize)
            if embed and m.i in embed:
                embeddings.append(nn.functional.adaptive_avg_pool2d(x, (1, 1)).squeeze(-1).squeeze(-1))  # flatten
                if m.i == max(embed):
                    return torch.unbind(torch.cat(embeddings, 1), dim=0)
        return x

(3)修改parse_model函数

可以直接把下面的代码粘贴到对应的位置中

def parse_model(d, ch, verbose=True):  # model_dict, input_channels(3)
    """
    Parse a YOLO model.yaml dictionary into a PyTorch model.

    Args:
        d (dict): Model dictionary.
        ch (int): Input channels.
        verbose (bool): Whether to print model details.

    Returns:
        (tuple): Tuple containing the PyTorch model and sorted list of output layers.
    """
    import ast

    # Args
    max_channels = float("inf")
    nc, act, scales = (d.get(x) for x in ("nc", "activation", "scales"))
    depth, width, kpt_shape = (d.get(x, 1.0) for x in ("depth_multiple", "width_multiple", "kpt_shape"))
    if scales:
        scale = d.get("scale")
        if not scale:
            scale = tuple(scales.keys())[0]
            LOGGER.warning(f"WARNING ⚠️ no model scale passed. Assuming scale='{scale}'.")
        if len(scales[scale]) == 3:
            depth, width, max_channels = scales[scale]
        elif len(scales[scale]) == 4:
            depth, width, max_channels, threshold = scales[scale]

    if act:
        Conv.default_act = eval(act)  # redefine default activation, i.e. Conv.default_act = nn.SiLU()
        if verbose:
            LOGGER.info(f"{colorstr('activation:')} {act}")  # print

    if verbose:
        LOGGER.info(f"
{'':>3}{'from':>20}{'n':>3}{'params':>10}  {'module':<60}{'arguments':<50}")
    ch = [ch]
    layers, save, c2 = [], [], ch[-1]  # layers, savelist, ch out
    is_backbone = False
    for i, (f, n, m, args) in enumerate(d["backbone"] + d["head"]):  # from, number, module, args
        try:
            if m == 'node_mode':
                m = d[m]
                if len(args) > 0:
                    if args[0] == 'head_channel':
                        args[0] = int(d[args[0]])
            t = m
            m = getattr(torch.nn, m[3:]) if 'nn.' in m else globals()[m]  # get module
        except:
            pass
        for j, a in enumerate(args):
            if isinstance(a, str):
                with contextlib.suppress(ValueError):
                    try:
                        args[j] = locals()[a] if a in locals() else ast.literal_eval(a)
                    except:
                        args[j] = a
        n = n_ = max(round(n * depth), 1) if n > 1 else n  # depth gain
        if m in {
            Classify, Conv, ConvTranspose, GhostConv, Bottleneck, GhostBottleneck, SPP, SPPF, DWConv, Focus,
            BottleneckCSP, C1, C2, C2f, ELAN1, AConv, SPPELAN, C2fAttn, C3, C3TR,
            C3Ghost, nn.Conv2d, nn.ConvTranspose2d, DWConvTranspose2d, C3x, RepC3, PSA, SCDown, C2fCIB

        }:
            if args[0] == 'head_channel':
                args[0] = d[args[0]]
            c1, c2 = ch[f], args[0]
            if c2 != nc:  # if c2 not equal to number of classes (i.e. for Classify() output)
                c2 = make_divisible(min(c2, max_channels) * width, 8)
            if m is C2fAttn:
                args[1] = make_divisible(min(args[1], max_channels // 2) * width, 8)  # embed channels
                args[2] = int(
                    max(round(min(args[2], max_channels // 2 // 32)) * width, 1) if args[2] > 1 else args[2]
                )  # num heads

            args = [c1, c2, *args[1:]]

        elif m in {AIFI}:
            args = [ch[f], *args]
            c2 = args[0]
        elif m in (HGStem, HGBlock):
            c1, cm, c2 = ch[f], args[0], args[1]
            if c2 != nc:  # if c2 not equal to number of classes (i.e. for Classify() output)
                c2 = make_divisible(min(c2, max_channels) * width, 8)
                cm = make_divisible(min(cm, max_channels) * width, 8)
            args = [c1, cm, c2, *args[2:]]
            if m in (HGBlock):
                args.insert(4, n)  # number of repeats
                n = 1
        elif m is ResNetLayer:
            c2 = args[1] if args[3] else args[1] * 4
        elif m is nn.BatchNorm2d:
            args = [ch[f]]
        elif m is Concat:
            c2 = sum(ch[x] for x in f)
        elif m in frozenset({Detect, WorldDetect, Segment, Pose, OBB, ImagePoolingAttn, v10Detect}):
            args.append([ch[x] for x in f])
        elif m is RTDETRDecoder:  # special case, channels arg must be passed in index 1
            args.insert(1, [ch[x] for x in f])
        elif m is CBLinear:
            c2 = make_divisible(min(args[0][-1], max_channels) * width, 8)
            c1 = ch[f]
            args = [c1, [make_divisible(min(c2_, max_channels) * width, 8) for c2_ in args[0]], *args[1:]]
        elif m is CBFuse:
            c2 = ch[f[-1]]
        elif isinstance(m, str):
            t = m
            if len(args) == 2:
                m = timm.create_model(m, pretrained=args[0], pretrained_cfg_overlay={'file': args[1]},
                                      features_only=True)
            elif len(args) == 1:
                m = timm.create_model(m, pretrained=args[0], features_only=True)
            c2 = m.feature_info.channels()
        elif m in {EfficientViT_M0, EfficientViT_M1, EfficientViT_M2, EfficientViT_M3, EfficientViT_M4, EfficientViT_M5
                   }:
            m = m(*args)
            c2 = m.channel
        else:
            c2 = ch[f]


        if isinstance(c2, list):
            is_backbone = True
            m_ = m
            m_.backbone = True
        else:
            m_ = nn.Sequential(*(m(*args) for _ in range(n))) if n > 1 else m(*args)  # module
            t = str(m)[8:-2].replace('__main__.', '')  # module type
        m.np = sum(x.numel() for x in m_.parameters())  # number params
        m_.i, m_.f, m_.type = i + 4 if is_backbone else i, f, t  # attach index, 'from' index, type
        if verbose:
            LOGGER.info(f"{i:>3}{str(f):>20}{n_:>3}{m.np:10.0f}  {t:<60}{str(args):<50}")  # print
        save.extend(x % (i + 4 if is_backbone else i) for x in ([f] if isinstance(f, int) else f) if
                    x != -1)  # append to savelist
        layers.append(m_)
        if i == 0:
            ch = []
        if isinstance(c2, list):
            ch.extend(c2)
            for _ in range(5 - len(ch)):
                ch.insert(0, 0)
        else:
            ch.append(c2)
    return nn.Sequential(*layers), sorted(save)

 具体改进差别如下图所示:

第③步:yolov8.yaml文件修改  

在下述文件夹中创立yolov8-efficientViT.yaml 

# Parameters
nc: 80  # number of classes
scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'
  # [depth, width, max_channels]
  n: [0.33, 0.25, 1024]  # YOLOv8n summary: 225 layers,  3157200 parameters,  3157184 gradients,   8.9 GFLOPs
  s: [0.33, 0.50, 1024]  # YOLOv8s summary: 225 layers, 11166560 parameters, 11166544 gradients,  28.8 GFLOPs
  m: [0.67, 0.75, 768]   # YOLOv8m summary: 295 layers, 25902640 parameters, 25902624 gradients,  79.3 GFLOPs
  l: [1.00, 1.00, 512]   # YOLOv8l summary: 365 layers, 43691520 parameters, 43691504 gradients, 165.7 GFLOPs
  x: [1.00, 1.25, 512]   # YOLOv8x summary: 365 layers, 68229648 parameters, 68229632 gradients, 258.5 GFLOPs

# 0-P1/2
# 1-P2/4
# 2-P3/8
# 3-P4/16
# 4-P5/32

# YOLOv8.0n backbone
backbone:
  # [from, repeats, module, args]
  - [-1, 1, EfficientViT_M0, []]  # 4
  - [-1, 1, SPPF, [1024, 5]]  # 5

# YOLOv8.0n head
head:
  - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # 6
  - [[-1, 3], 1, Concat, [1]]  # 7 cat backbone P4
  - [-1, 3, C2f, [512]]  # 8

  - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # 9
  - [[-1, 2], 1, Concat, [1]]  # 10 cat backbone P3
  - [-1, 3, C2f, [256]]  # 11 (P3/8-small)

  - [-1, 1, Conv, [256, 3, 2]] # 12
  - [[-1, 8], 1, Concat, [1]]  # 13 cat head P4
  - [-1, 3, C2f, [512]]  # 14 (P4/16-medium)

  - [-1, 1, Conv, [512, 3, 2]] # 15
  - [[-1, 5], 1, Concat, [1]]  # 16 cat head P5
  - [-1, 3, C2f, [1024]]  # 17 (P5/32-large)

  - [[11, 14, 17], 1, Detect, [nc]]  # Detect(P3, P4, P5)

第④步:验证是否加入成功  

将train.py中的配置文件进行修改,并运行 


🏋不是每一粒种子都能开花,但播下种子就比荒芜的旷野强百倍🏋

🍁YOLOv8入门+改进专栏🍁


   【YOLOv8改进系列】: 

【YOLOv8】YOLOv8结构解读

YOLOv8改进系列(1)----替换主干网络之EfficientViT 

YOLOv8改进系列(2)----替换主干网络之FasterNet

YOLOv8改进系列(3)----替换主干网络之ConvNeXt V2

YOLOv8改进系列(4)----替换C2f之FasterNet中的FasterBlock替换C2f中的Bottleneck 

YOLOv8改进系列(5)----替换主干网络之EfficientFormerV2 

YOLOv8改进系列(6)----替换主干网络之VanillaNet

YOLOv8改进系列(7)----替换主干网络之LSKNet

YOLOv8改进系列(8)----替换主干网络之Swin Transformer 

YOLOv8改进系列(9)----替换主干网络之RepViT


本文地址:https://www.vps345.com/8298.html

搜索文章

Tags

PV计算 带宽计算 流量带宽 服务器带宽 上行带宽 上行速率 什么是上行带宽? CC攻击 攻击怎么办 流量攻击 DDOS攻击 服务器被攻击怎么办 源IP 服务器 linux 运维 游戏 云计算 javascript 前端 chrome edge llama 算法 opencv 自然语言处理 神经网络 语言模型 阿里云 网络 网络安全 网络协议 ubuntu ssh php 人工智能 deepseek Ollama 模型联网 API CherryStudio python MCP 进程 操作系统 进程控制 Ubuntu jenkins gitee spring boot java macos tomcat docker asm C# MQTTS 双向认证 emqx adb mysql android RTSP xop RTP RTSPServer 推流 视频 harmonyos 华为 开发语言 typescript 计算机网络 英语 debian PVE json 容器 数据库 centos oracle 关系型 安全 分布式 经验分享 windows conda 机器学习 科技 ai 个人开发 nginx 负载均衡 Dify 开发环境 vscode 笔记 jellyfin nas tcp/ip openvpn server openvpn配置教程 centos安装openvpn numpy 嵌入式 linux驱动开发 arm开发 嵌入式硬件 持续部署 c++ 并查集 leetcode HarmonyOS Next 智能路由器 外网访问 内网穿透 端口映射 Linux 进程信号 vnc MacOS录屏软件 Docker Hub docker pull 镜像源 daemon.json gnu 面试 性能优化 jdk intellij-idea 架构 GaN HEMT 氮化镓 单粒子烧毁 辐射损伤 辐照效应 k8s kubernetes 自动化 spring protobuf 序列化和反序列化 安装 vue3 HTML audio 控件组件 vue3 audio音乐播放器 Audio标签自定义样式默认 vue3播放音频文件音效音乐 自定义audio播放器样式 播放暂停调整声音大小下载文件 mac 游戏程序 ios ue5 vr c# github 创意 社区 虚拟机 VMware ip命令 新增网卡 新增IP 启动网卡 学习 多线程 fstab Flask FastAPI Waitress Gunicorn uWSGI Uvicorn 计算机外设 电脑 软件需求 EtherCAT转Modbus ECT转Modbus协议 EtherCAT转485网关 ECT转Modbus串口网关 EtherCAT转485协议 ECT转Modbus网关 物联网 mcu iot 信息与通信 YOLO efficientVIT YOLOv8替换主干网络 TOLOv8 xcode ide 产品经理 agi microsoft vim 运维开发 云原生 llm transformer git elasticsearch 网络药理学 生信 生物信息学 gromacs 分子动力学模拟 MD 动力学模拟 ip 高级IO epoll 数据结构 c语言 学习方法 powerpoint pycharm dify DevEco Studio windows 服务器安装 Dell R750XS 宝塔面板访问不了 宝塔面板网站访问不了 宝塔面板怎么配置网站能访问 宝塔面板配置ip访问 宝塔面板配置域名访问教程 宝塔面板配置教程 sublime text 编辑器 vue.js audio vue音乐播放器 vue播放音频文件 Audio音频播放器自定义样式 播放暂停进度条音量调节快进快退 自定义audio覆盖默认样式 unix java-ee 开源 实时音视频 实时互动 rust http etcd 数据安全 RBAC 互信 fastapi mcp mcp-proxy mcp-inspector fastapi-mcp agent sse Qwen2.5-coder 离线部署 深度学习 目标检测 计算机视觉 redis 思科 pip filezilla 无法连接服务器 连接被服务器拒绝 vsftpd 331/530 word图片自动上传 word一键转存 复制word图片 复制word图文 复制word公式 粘贴word图文 粘贴word公式 eureka ui 华为云 华为od 鸿蒙 ssl 前端框架 kylin pytorch OpenManus jmeter 软件测试 iftop 网络流量监控 DNS HCIE 数通 perf linux内核 list 安卓模拟器 大数据 gateway Clion Nova ResharperC++引擎 Centos7 远程开发 多线程服务器 Linux网络编程 node.js 指令 mq rabbitmq rocketmq kafka FTP 服务器 iperf3 带宽测试 golang 文件系统 路径解析 Doris搭建 docker搭建Doris Doris搭建过程 linux搭建Doris Doris搭建详细步骤 Doris部署 pillow udp 本地环回 bind html5 firefox ollama下载加速 大模型 sqlserver live555 rtsp rtp https 设置代理 实用教程 后端 WSL win11 无法解析服务器的名称或地址 websocket 集成学习 集成测试 NFS web安全 Kali Linux 黑客 渗透测试 信息收集 WebUI DeepSeek V3 DeepSeek AI大模型 单片机 权限 dubbo 小程序 微信小程序域名配置 微信小程序服务器域名 微信小程序合法域名 小程序配置业务域名 微信小程序需要域名吗 微信小程序添加域名 ux bcompare Beyond Compare 程序人生 minicom 串口调试工具 测试工具 fd 文件描述符 webstorm log4j apache 强制清理 强制删除 mac废纸篓 代码调试 ipdb stm32 qt Windsurf 缓存 kali 共享文件夹 源码剖析 rtsp实现步骤 流媒体开发 中间件 iis 机器人 视觉检测 rpc VMware创建虚拟机 linux安装配置 xml DeepSeek-R1 API接口 远程工作 jar gradle cpu 内存 实时 使用 gcc centos 7 WSL2 Ubuntu22.04 虚拟化 开发人员主页 Linux的权限 .net AI 爬虫 数据集 远程控制 远程看看 远程协助 中兴光猫 换光猫 网络桥接 自己换光猫 selenium maven C语言 硬件工程 WLAN ipython rancher VMware安装mocOS macOS系统安装 flutter Hyper-V WinRM TrustedHosts fpga开发 prometheus 监控k8s 监控kubernetes 串口服务器 鸿蒙系统 KylinV10 麒麟操作系统 Vmware Ubuntu共享文件夹 共享目录 Linux共享文件夹 iBMC UltraISO YOLOv8 NPU Atlas800 A300I pro asi_bench bash uni-app DigitalOcean GPU服务器购买 GPU服务器哪里有 GPU服务器 rime 统信UOS 麒麟 bonding 链路聚合 bug 系统开发 binder 车载系统 framework 源码环境 Samba NAS mount挂载磁盘 wrong fs type LVM挂载磁盘 Centos7.9 ip协议 安装教程 GPU环境配置 Ubuntu22 CUDA PyTorch Anaconda安装 ESP32 camera Arduino 电子信息 压测 ECS stm32项目 课程设计 Linux PID windows日志 unity QT 5.12.12 QT开发环境 Ubuntu18.04 监控k8s集群 集群内prometheus 域名服务 DHCP 符号链接 配置 无人机 5G 3GPP 卫星通信 媒体 微信 微信分享 Image wxopensdk RAGFLOW 聚类 vmware 卡死 Cline 自动化编程 AI编程 openwrt go 代理模式 ssh漏洞 ssh9.9p2 CVE-2025-23419 dell服务器 postgresql 政务 分布式系统 监控运维 Prometheus Grafana ros2 moveit 机器人运动 ai小智 语音助手 ai小智配网 ai小智教程 智能硬件 esp32语音助手 diy语音助手 selete react.js 前端面试题 wireshark 显示过滤器 ICMP Wireshark安装 linux环境变量 环境配置 隐藏文件 隐藏目录 管理器 通配符 低代码 迁移指南 数据挖掘 网络用户购物行为分析可视化平台 大数据毕业设计 1024程序员节 AI写作 程序员创富 基础环境 UOS 统信操作系统 yum oceanbase rc.local 开机自启 systemd mybatis 链表 docker搭建pg docker搭建pgsql pg授权 postgresql使用 postgresql搭建 命名管道 客户端与服务端通信 ddos ollama spring cloud chatgpt llama3 Chatglm 开源大模型 向日葵 nftables 防火墙 ping++ matplotlib docker搭建nacos详解 docker部署nacos docker安装nacos 腾讯云搭建nacos centos7搭建nacos svn 远程 命令 执行 sshpass 操作 大模型技术 本地部署大模型 zotero WebDAV 同步失败 linux上传下载 ffmpeg 音视频 客户端 flask AIGC 温湿度数据上传到服务器 Arduino HTTP ansible playbook 剧本 docker compose 虚拟局域网 windwos防火墙 defender防火墙 win防火墙白名单 防火墙白名单效果 防火墙只允许指定应用上网 防火墙允许指定上网其它禁止 工业4.0 ESXi sql KingBase visual studio code C 环境变量 进程地址空间 WSL2 上安装 Ubuntu 深度求索 私域 知识库 博客 tcpdump 系统架构 微服务 设计模式 软件工程 模拟实现 腾讯云大模型知识引擎 Deepseek CPU 主板 电源 网卡 Agent 数据分析 express p2p alias unalias 别名 银河麒麟 kylin v10 麒麟 v10 threejs 3D 报错 目标跟踪 OpenVINO 推理应用 智能手机 Termux aws googlecloud cuda cudnn anaconda 监控 自动化运维 gitlab 安防软件 postman mock mock server 模拟服务器 mock服务器 Postman内置变量 Postman随机数据 Reactor C++ docker-compose VMware安装Ubuntu Ubuntu安装k8s JAVA Java LDAP fonts-noto-cjk 开发 僵尸进程 YOLOv12 hive Hive环境搭建 hive3环境 Hive远程模式 腾讯云 gpu算力 intellij idea flash-attention 云桌面 微软 AD域控 证书服务器 .netcore CLion 远程连接 IDE firewalld 大数据平台 kamailio sip VoIP rust腐蚀 spark Ubuntu Server Ubuntu 22.04.5 键盘 rag ragflow ragflow 源码启动 豆瓣 追剧助手 迅雷 Portainer搭建 Portainer使用 Portainer使用详解 Portainer详解 Portainer portainer virtualenv ue4 着色器 虚幻 mongodb MQTT协议 消息服务器 代码 springcloud vSphere vCenter 软件定义数据中心 sddc 飞牛nas fnos IM即时通讯 QQ 企业微信 剪切板对通 HTML FORMAT conda配置 conda镜像源 matlab MQTT 消息队列 saltstack 传统数据库升级 银行 智能音箱 智能家居 大语言模型 LLMs IPMITOOL BMC 硬件管理 arm opcua opcda KEPServer安装 oneapi 大模型微调 open webui make命令 makefile文件 DeepSeek r1 Open WebUI 部署 镜像 AI-native Docker Desktop XCC Lenovo 免费域名 域名解析 asp.net大文件上传 asp.net大文件上传下载 asp.net大文件上传源码 ASP.NET断点续传 asp.net上传文件夹 asp.net上传大文件 .net core断点续传 繁忙 服务器繁忙 解决办法 替代网站 汇总推荐 AI推理 eclipse 热榜 pdf x64 SIGSEGV SSE xmm0 ci/cd 图像处理 稳定性 看门狗 VSCode 华为认证 网络工程师 交换机 Typore 游戏引擎 移动云 鲲鹏 MS Materials android studio 策略模式 单例模式 可信计算技术 密码学 安全架构 安全威胁分析 grafana 安卓 微信小程序 miniapp 真机调试 调试 debug 断点 网络API请求调试方法 图形化界面 跨域 skynet SSL 域名 vue ROS 自动驾驶 边缘计算 硬件架构 AISphereButler 办公自动化 自动化生成 pdf教程 embedding xpath定位元素 redhat bat shell 卷积神经网络 visualstudio 系统安全 nfs 交叉编译 Trae AI 原生集成开发环境 Trae AI 上传视频文件到服务器 uniApp本地上传视频并预览 uniapp移动端h5网页 uniapp微信小程序上传视频 uniapp app端视频上传 uniapp uview组件库 小番茄C盘清理 便捷易用C盘清理工具 小番茄C盘清理的优势尽显何处? 教你深度体验小番茄C盘清理 C盘变红?!不知所措? C盘瘦身后电脑会发生什么变化? 驱动开发 嵌入式实习 大模型部署 Ubuntu DeepSeek DeepSeek Ubuntu DeepSeek 本地部署 DeepSeek 知识库 DeepSeek 私有化知识库 本地部署 DeepSeek DeepSeek 私有化部署 蓝耘科技 元生代平台工作流 ComfyUI mamba Vmamba LORA NLP css less devops springboot 自动化任务管理 职场和发展 CH340 串口驱动 CH341 uart 485 EasyConnect zip unzip 软链接 硬链接 ecmascript nextjs react reactjs URL RustDesk自建服务器 rustdesk服务器 docker rustdesk 黑客技术 RAG 检索增强生成 文档解析 大模型垂直应用 web SSH 服务 SSH Server OpenSSH Server 流式接口 django web3.py 本地部署 api pyqt npm pyautogui Kylin-Server 国产操作系统 服务器安装 zabbix kvm qemu libvirt powerbi 信息可视化 prompt 模拟器 教程 tcp big data Google pay Apple pay hadoop opensearch helm 推荐算法 服务器主板 AI芯片 搜索引擎 Linux无人智慧超市 LInux多线程服务器 QT项目 LInux项目 单片机项目 MI300x 交互 WebRTC gpt ssrf 失效的访问控制 医疗APP开发 app开发 ROS2 edge浏览器 计算机 string模拟实现 深拷贝 浅拷贝 经典的string类问题 三个swap 游戏服务器 TrinityCore 魔兽世界 SSL证书 elk cd 目录切换 Python 网络编程 聊天服务器 套接字 TCP Socket 文心一言 adobe webrtc dba Xinference RAGFlow ros 话题通信 服务通信 xrdp 远程桌面 minio Ubuntu 24.04.1 轻量级服务器 Ark-TS语言 apt 国内源 群晖 文件分享 wsl docker命令大全 云服务 NPS 雨云服务器 雨云 virtualbox tensorflow 宝塔面板无法访问 其他 ubuntu20.04 开机黑屏 springsecurity6 oauth2 授权服务器 token sas DocFlow odoo 服务器动作 Server action 智能电视 崖山数据库 YashanDB 信号处理 db ubuntu24 vivado24 环境迁移 r语言 数据可视化 k8s集群资源管理 云原生开发 服务器部署ai模型 sqlite3 Anolis nginx安装 环境安装 linux插件下载 直播推流 软件构建 rsyslog 毕设 服务器数据恢复 数据恢复 存储数据恢复 raid5数据恢复 磁盘阵列数据恢复 虚拟显示器 视频编解码 cmos 硬件 银河麒麟操作系统 国产化 微信公众平台 burp suite 抓包 重启 排查 系统重启 日志 原因 三级等保 服务器审计日志备份 单元测试 功能测试 pygame risc-v 3d 灵办AI lsb_release /etc/issue /proc/version uname -r 查看ubuntu版本 RoboVLM 通用机器人策略 VLA设计哲学 vlm fot robot 视觉语言动作模型 具身智能 c LLM 大模型面经 大模型学习 AnythingLLM AnythingLLM安装 okhttp 换源 Debian bootstrap html HarmonyOS NEXT 原生鸿蒙 软考 jupyter 联想开天P90Z装win10 实习 计算生物学 生物信息 基因组 WebVM wsl2 流水线 脚本式流水线 压力测试 大文件分片上传断点续传及进度条 如何批量上传超大文件并显示进度 axios大文件切片上传详细教 node服务器合并切片 vue3大文件上传报错提示错误 大文件秒传跨域报错cors 网工 trae GCC crosstool-ng 宕机切换 服务器宕机 CrewAI 数据库架构 数据管理 数据治理 数据编织 数据虚拟化 Deepseek-R1 私有化部署 推理模型 firewall idm 金仓数据库 2025 征文 数据库平替用金仓 MCP server C/S ros1 Noetic 20.04 apt 安装 本地部署AI大模型 DOIT 四博智联 多层架构 解耦 java-rabbitmq 飞牛 iDRAC R720xd 能力提升 面试宝典 技术 IT信息化 分析解读 树莓派 VNC thingsboard IIS .net core Hosting Bundle .NET Framework vs2022 AP配网 AK配网 小程序AP配网和AK配网教程 WIFI设备配网小程序UDP开 CentOS Stream CentOS database XFS xfs文件系统损坏 I_O error docker run 数据卷挂载 交互模式 信号 磁盘监控 DIFY 相差8小时 UTC 时间 netty mariadb 输入法 gitea 技能大赛 FunASR ASR compose 强化学习 file server http server web server MacMini Mac 迷你主机 mini Apple 状态管理的 UDP 服务器 Arduino RTOS 宠物 毕业设计 免费学习 宠物领养 宠物平台 蓝桥杯 小艺 Pura X etl 嵌入式系统开发 服务器配置 excel openEuler 网络攻击模型 n8n dity make 王者荣耀 notepad nlp Wi-Fi eNSP 网络规划 VLAN 企业网络 yolov5 HarmonyOS Kali 网络管理 2024 2024年上半年 下午真题 答案 telnet 远程登录 IO maxkb ARG banner Invalid Host allowedHosts gpt-3 rdp 实验 主从复制 Docker引擎已经停止 Docker无法使用 WSL进度一直是0 镜像加速地址 云电竞 云电脑 todesk export import save load 迁移镜像 执法记录仪 智能安全帽 smarteye 设备 GPU PCI-Express SysBench 基准测试 tar k8s资源监控 annotations自动化 自动化监控 监控service 监控jvm 服务器时间 VR手套 数据手套 动捕手套 动捕数据手套 实战案例 序列化反序列化 searxng Redis Desktop Erlang OTP gen_server 热代码交换 事务语义 rclone AList webdav fnOS ruby MNN Qwen 线程 cfssl Docker Compose av1 电视盒子 机顶盒ROM 魔百盒刷机 拓扑图 数学建模 Minecraft 网络结构图 can 线程池 深度优先 图论 并集查找 换根法 树上倍增 neo4j 数据仓库 数据库开发 双系统 GRUB引导 Linux技巧 宝塔面板 Linux的基础指令 磁盘清理 DeepSeek行业应用 Heroku 网站部署 Dell HPE 联想 浪潮 TRAE 程序员 Playwright 自动化测试 freebsd ssh远程登录 keepalived P2P HDLC sonoma 自动更新 nac 802.1 portal gaussdb 服务器管理 配置教程 网站管理 健康医疗 互联网医院 safari 系统 测试用例 .net mvc断点续传 chrome devtools chromedriver 区块链 私有化 AI作画 历史版本 下载 ruoyi 聊天室 程序 编程 性能分析 next.js 部署next.js 统信 UOS1070e ArcTS 登录 ArcUI GridItem RAID RAID技术 磁盘 存储 arkUI 代码托管服务 思科模拟器 Cisco ocr uv Alexnet 算力 lb 协议 wps milvus muduo nvidia X11 Xming yaml Ultralytics 可视化 Cursor c/c++ 串口 ceph 银河麒麟服务器操作系统 系统激活 AI代码编辑器 矩阵 7z 社交电子 rnn 显卡驱动 高效远程协作 TrustViewer体验 跨设备操作便利 智能远程控制 KVM OpenHarmony OpenSSH vpn 上传视频至服务器代码 vue3批量上传多个视频并预览 如何实现将本地视频上传到网页 element plu视频上传 ant design vue vue3本地上传视频及预览移除 SEO Linux24.04 deepin 漏洞 像素流送api 像素流送UE4 像素流送卡顿 像素流送并发支持 用户缓冲区 金融 seatunnel 网站搭建 serv00 jetty undertow 支付 微信支付 开放平台 ArkTs ArkUI 图形渲染 vscode 1.86 微信开放平台 微信公众号配置 小游戏 五子棋 直流充电桩 充电桩 IPMI sdkman jina IPv4 子网掩码 公网IP 私有IP 弹性计算 云服务器 裸金属服务器 弹性裸金属服务器 产测工具框架 IMX6ULL 管理框架 Mac内存不够用怎么办 k8s二次开发 集群管理 unity3d cocoapods 进程优先级 调度队列 进程切换 SSH Xterminal SenseVoice DBeaver composer 相机 cron crontab日志 毕昇JDK yolov8 端口测试 springboot远程调试 java项目远程debug docker远程debug java项目远程调试 springboot远程 渗透 mysql离线安装 ubuntu22.04 mysql8.0 hugo 源码 虚拟现实 Netty 即时通信 NIO 游戏机 SWAT 配置文件 服务管理 网络共享 混合开发 JDK 版本 考研 京东云 IIS服务器 IIS性能 日志监控 半虚拟化 硬件虚拟化 Hypervisor 命令行 基础入门 宝塔 AutoDL micropython esp32 mqtt lio-sam SLAM nuxt3 centos-root /dev/mapper yum clean all df -h / du -sh Node-Red 编程工具 流编程 trea idea Jellyfin sqlite pgpool ubuntu24.04.1 Cookie su sudo 业界资讯 TrueLicense 模拟退火算法 NLP模型 openssl 自学笔记 小米 澎湃OS Android 田俊楠 chrome 浏览器下载 chrome 下载安装 谷歌浏览器下载 mosquitto EtherNet/IP串口网关 EIP转RS485 EIP转Modbus EtherNet/IP网关协议 EIP转RS485网关 EIP串口服务器 多进程 HiCar CarLife+ CarPlay QT RK3588 code-server 浏览器自动化 outlook 读写锁 echarts 网页设计 数据库系统 MySql fast hibernate curl wget 工作流 workflow visual studio cnn ukui 麒麟kylinos openeuler 邮件APP 免费软件 虚拟机安装 SSH 密钥生成 SSH 公钥 私钥 生成 框架搭建 kind 同步 备份 建站 Java Applet URL操作 服务器建立 Socket编程 网络文件读取 linux 命令 sed 命令 大模型入门 大模型教程 昇腾 npu remote-ssh 飞牛NAS 飞牛OS MacBook Pro W5500 OLED u8g2 TCP服务器 arcgis chfs ubuntu 16.04 开机自启动 rustdesk easyui langchain 网络穿透 国产数据库 瀚高数据库 数据迁移 下载安装 火绒安全 Nuxt.js VPS ShenTong vu大文件秒传跨域报错cors Linux awk awk函数 awk结构 awk内置变量 awk参数 awk脚本 awk详解 yum源切换 更换国内yum源 恒源云 bot Docker 致远OA OA服务器 服务器磁盘扩容 OD机试真题 华为OD机试真题 服务器能耗统计 RTMP 应用层 通信工程 毕业 代理 CORS dns uniapp 飞书 孤岛惊魂4 iphone 抓包工具 北亚数据恢复 oracle数据恢复 单一职责原则 Reactor反应堆 远程服务 语音识别 语法 IMM 网易邮箱大师 机柜 1U 2U HistoryServer Spark YARN jobhistory 网络文件系统 Headless Linux 阿里云ECS CDN wpf qt5 客户端开发 李心怡 查看显卡进程 fuser navicat ArtTS React Next.js 开源框架 云耀服务器 自定义客户端 SAS zookeeper flink MDK 嵌入式开发工具 论文笔记 GIS 遥感 WebGIS 大大通 第三代半导体 碳化硅 docker部署翻译组件 docker部署deepl docker搭建deepl java对接deepl 翻译组件使用 离线部署dify Windows ai工具 java-rocketmq 回显服务器 UDP的API使用 ldap armbian u-boot g++ g++13 docker部署Python nvm whistle Attention Linux环境 内网环境 h.264 项目部署到linux服务器 项目部署过程 GameFramework HybridCLR Unity编辑器扩展 自动化工具 ftp 企业网络规划 华为eNSP vscode1.86 1.86版本 ssh远程连接 open Euler dde 网络爬虫 LLM Web APP Streamlit 网卡的名称修改 eth0 ens33 cpp-httplib ebpf uprobe 本地化部署 DenseNet onlyoffice SRS 流媒体 直播 sysctl.conf vm.nr_hugepages opengl 电视剧收视率分析与可视化平台 信创 信创终端 中科方德 cursor 开源软件 Mac软件 tidb GLIBC dash 正则表达式 wordpress 无法访问wordpess后台 打开网站页面错乱 linux宝塔面板 wordpress更换服务器 嵌入式Linux IPC kotlin hosts EMUI 回退 降级 升级 jvm 搭建个人相关服务器 多端开发 智慧分发 应用生态 鸿蒙OS 高效日志打印 串口通信日志 服务器日志 系统状态监控日志 异常记录日志 Sealos 镜像下载 论文阅读 怎么卸载MySQL MySQL怎么卸载干净 MySQL卸载重新安装教程 MySQL5.7卸载 Linux卸载MySQL8.0 如何卸载MySQL教程 MySQL卸载与安装 oracle fusion oracle中间件 硅基流动 ChatBox perl 僵尸世界大战 游戏服务器搭建 远程过程调用 Windows环境 axure 富文本编辑器 沙盒 swoole deep learning Ubuntu 24 常用命令 Ubuntu 24 Ubuntu vi 异常处理 影刀 #影刀RPA# FTP服务器 v10 软件 vllm WebServer Helm k8s集群 无桌面 元服务 应用上架 多个客户端访问 IO多路复用 TCP相关API Mermaid 可视化图表 网络建设与运维 网络搭建 神州数码 神州数码云平台 云平台 架构与原理 IDEA figma 音乐库 tailscale derp derper 中转 triton 模型分析 知识图谱 AI员工 C++软件实战问题排查经验分享 0xfeeefeee 0xcdcdcdcd 动态库加载失败 程序启动失败 程序运行权限 标准用户权限与管理员权限 Linux 维护模式 反向代理 PPI String Cytoscape CytoHubba aarch64 编译安装 HPC 欧标 OCPP deekseek top Linux top top命令详解 top命令重点 top常用参数 Zoertier 内网组网 lua 服务器扩容没有扩容成功 vue-i18n 国际化多语言 vue2中英文切换详细教程 如何动态加载i18n语言包 把语言json放到服务器调用 前端调用api获取语言配置文件 增强现实 沉浸式体验 应用场景 技术实现 案例分析 AR GoogLeNet LInux Unity Dedicated Server Host Client 无头主机 react native USB网络共享 性能测试 H3C 虚幻引擎 视频平台 录像 视频转发 视频流 授时服务 北斗授时 问题解决 常用命令 文本命令 目录命令 python3.11 服务器无法访问 ip地址无法访问 无法访问宝塔面板 宝塔面板打不开 es midjourney ubuntu 18.04 Qwen2.5-VL 前后端分离 MVS 海康威视相机 浏览器开发 AI浏览器 clickhouse sentinel 佛山戴尔服务器维修 佛山三水服务器维修 nosql Python基础 Python教程 Python技巧 proxy模式 burpsuite 安全工具 mac安全工具 burp安装教程 渗透工具 烟花代码 烟花 元旦 性能调优 安全代理 本地知识库部署 DeepSeek R1 模型 匿名管道 干货分享 黑客工具 密码爆破 Claude 技术共享 copilot Spring Security 我的世界 我的世界联机 数码 网页服务器 web服务器 Nginx 在线office 加解密 Yakit yaklang 我的世界服务器搭建 Web服务器 多线程下载工具 PYTHON win服务器架设 windows server 人工智能生成内容 线性代数 电商平台 浪潮信息 AI服务器 ecm bpm ISO镜像作为本地源 openstack Xen Web应用服务器 备份SQL Server数据库 数据库备份 傲梅企业备份网络版 抗锯齿 word 音乐服务器 Navidrome 音流 多路转接 xss 智慧农业 开源鸿蒙 团队开发 dns是什么 如何设置电脑dns dns应该如何设置 在线预览 xlsx xls文件 在浏览器直接打开解析xls表格 前端实现vue3打开excel 文件地址url或接口文档流二进 软件卸载 系统清理 pppoe radius xshell termius iterm2 llama.cpp 项目部署 Linux权限 权限命令 特殊权限 服务网格 istio AI agent Carla 智能驾驶 dock 加速 MAC SecureCRT 个人博客 uni-file-picker 拍摄从相册选择 uni.uploadFile H5上传图片 微信小程序上传图片 合成模型 扩散模型 图像生成 状态模式 大模型应用 rtsp服务器 rtsp server android rtsp服务 安卓rtsp服务器 移动端rtsp服务 大牛直播SDK EMQX 通信协议 计算虚拟化 弹性裸金属 IO模型 UEFI Legacy MBR GPT U盘安装操作系统 VS Code 鸿蒙开发 移动开发 ranger MySQL8.0 显示管理器 lightdm gdm 小智AI服务端 xiaozhi TTS frp 捆绑 链接 谷歌浏览器 youtube google gmail AD 域管理 grub 版本升级 扩容 阻塞队列 生产者消费者模型 服务器崩坏原因 PX4 kerberos 黑苹果 samba 容器技术 MacOS 游戏开发 hexo junit sequoiaDB 磁盘镜像 服务器镜像 服务器实时复制 实时文件备份 K8S k8s管理系统 ELF加载 seleium lvm 磁盘挂载 磁盘分区 glibc TCP协议 prometheus数据采集 prometheus数据模型 prometheus特点 备选 网站 调用 示例 达梦 DM8 银河麒麟桌面操作系统 Kylin OS AD域 minecraft mcp服务器 client close Logstash 日志采集 对比 工具 meld DiffMerge 服务器安全 网络安全策略 防御服务器攻击 安全威胁和解决方案 程序员博客保护 数据保护 安全最佳实践 HTTP 服务器控制 ESP32 DeepSeek 端口聚合 windows11 regedit 开机启动 CosyVoice Qualcomm WoS QNN AppBuilder 分布式训练 vasp安装 System V共享内存 进程通信 查询数据库服务IP地址 SQL Server 华为证书 HarmonyOS认证 华为证书考试 webgl kernel docker desktop image 玩机技巧 软件分享 软件图标 fork wait waitpid exit Radius qt项目 qt项目实战 qt教程 生活 国标28181 视频监控 监控接入 语音广播 流程 SIP SDP 软负载 MAVROS 四旋翼无人机 物联网开发 根服务器 华为机试 超融合 端口 查看 ss 银河麒麟高级服务器 外接硬盘 Kylin deployment daemonset statefulset cronjob 大屏端 做raid 装系统 移动魔百盒 python2 ubuntu24.04 USB转串口 harmonyOS面试题 代理服务器 需求分析 规格说明书 运维监控 rpa 内核 IMX317 MIPI H265 VCU CVE-2024-7347 内网服务器 内网代理 内网通信 HP Anyware VM搭建win2012 win2012应急响应靶机搭建 攻击者获取服务器权限 上传wakaung病毒 应急响应并溯源 挖矿病毒处置 应急响应综合性靶场 web3 极限编程 安装MySQL deepseek r1 Linux find grep 钉钉 DevOps 软件交付 数据驱动 多产物 解决方案 粘包问题 AzureDataStudio 蓝桥杯C++组 wsgiref Web 服务器网关接口 ShapeFile GeoJSON 负载测试 ardunio BLE Tabs组件 TabContent TabBar TabsController 导航页签栏 滚动导航栏 联机 僵尸毁灭工程 游戏联机 开服 k8s部署 MySQL8.0 高可用集群(1主2从) macOS 高德地图 鸿蒙接入高德地图 HarmonyOS5.0 数字证书 签署证书 mm-wiki搭建 linux搭建mm-wiki mm-wiki搭建与使用 mm-wiki使用 mm-wiki详解 高效I/O 蓝牙 yum换源 CNNs 图像分类 服务器正确解析请求体 ufw NAT转发 NAT Server 搜狗输入法 中文输入法 scapy 联网 easyconnect Unity插件 iventoy VmWare OpenEuler css3 风扇控制软件 scikit-learn 服务器部署 本地拉取打包 Chatbox 免密 公钥 私钥 lighttpd安装 Ubuntu配置 Windows安装 服务器优化 Apache Beam 批流统一 案例展示 数据分区 容错机制 UDP 带外管理 netlink libnl3 MobaXterm 流量运营 输入系统 跨平台 vmamba mysql安装报错 windows拒绝安装 显示器 CPU 使用率 系统监控工具 linux 命令 yashandb iNode Macos xfce 大模型推理 底层实现 cmake 桌面环境 NFC 近场通讯 智能门锁 vite diskgenius SVN Server tortoise svn 图片增强 增强数据 AI Agent 字节智能运维 接口优化 ABAP HAProxy shell脚本免交互 expect linux免交互 存储维护 NetApp存储 EMC存储 laravel es6 qt6.3 g726 csrutil mac恢复模式进入方法 恢复模式 西门子PLC 通讯 zerotier autodl Docker快速入门 内网渗透 靶机渗透 用户管理 VPN wireguard 端口号 开放端口 访问列表 管道 录音麦克风权限判断检测 录音功能 录音文件mp3播放 小程序实现录音及播放功能 RecorderManager 解决录音报错播放没声音问题 GeneCards OMIM TTD iTerm2 文件传输 solidworks安装 错误代码2603 无网络连接 2603 fiddler pyicu retry 重试机制 deepseak 豆包 KIMI 腾讯元宝 零售 小智 网络原理 Isaac Sim 虚拟仿真 Office 进程程序替换 execl函数 execv函数 execvp函数 execvpe函数 putenv函数 环境搭建 Maven initramfs Linux内核 Grub 配置原理 Pyppeteer 动静态库 ajax Linux Vim 华为OD 可以组成网络的服务器 弹性服务器 动态规划 实时内核 nohup后台启动 工具分享 一切皆文件 sudo原理 su切换 WINCC js VMware Tools vmware tools安装 vmwaretools安装步骤 vmwaretools安装失败 vmware tool安装步骤 vm tools安装步骤 vm tools安装后不能拖 vmware tools安装步骤 充电桩平台 充电桩开源平台 gunicorn 计算机科学与技术 锁屏不生效 玩游戏 代码规范 ArkTS 移动端开发 智能体开发 beautifulsoup EVE-NG 终端工具 远程工具 WireGuard 异地组网 deepseek-r1 大模型本地部署 stable diffusion 分子对接 autodock mgltools PDB PubChem 笔灵AI AI工具 电脑桌面出现linux图标 电脑桌面linux图标删除不了 电脑桌面Liunx图标删不掉 linux图标删不掉 ECT转485串口服务器 ECT转Modbus485协议 ECT转Modbus串口服务器 信息安全 qps 高并发 机械臂 autoware SystemV PyQt PySide6 umeditor粘贴word ueditor粘贴word ueditor复制word ueditor上传word图片 ueditor导入word ueditor导入pdf ueditor导入ppt 电路仿真 multisim 硬件工程师 硬件工程师学习 电路图 电路分析 仪器仪表 桌面快捷方式 nacos VGG网络 卷积层 池化层 servlet Ardupilot 大模型训练/推理 推理问题 mindie 大版本升 升级Ubuntu系统 进程间通信 安全漏洞 env 变量 空间 查错 ubuntu安装 linux入门小白 服务器ssl异常解决 终端 免费 Bug解决 Qt platform OpenCV ftp服务 文件上传 glm4 archlinux kde plasma 跨域请求 llamafactory 微调