PaddleVideo:Squeeze Time算法移植

 参考
PaddleVideo/docs/zh-CN/contribute/add_new_algorithm.md at develop · PaddlePaddle/PaddleVideo · GitHubAwesome video understanding toolkits based on PaddlePaddle. It supports video data annotation tools, lightweight RGB and skeleton based action recognition model, practical applications for video tagging and sport action detection. - PaddleVideo/docs/zh-CN/contribute/add_new_algorithm.md at develop · PaddlePaddle/PaddleVideoicon-default.png?t=N7T8https://github.com/PaddlePaddle/PaddleVideo/blob/develop/docs/zh-CN/contribute/add_new_algorithm.md

1:添加backbone:(网络我自己砍了几刀,目的是想和ppTSM-v2做对比)

paddlevideo/modeling/backbones/squeezetime.py

from __future__ import absolute_import, division, print_functionimport paddle
import paddle.nn as nn
from paddle import ParamAttr
from paddle.nn import AdaptiveAvgPool2D, BatchNorm, Conv2D, Dropout, Linear, BatchNorm2D
from paddle.regularizer import L2Decay
from paddle.nn.initializer import KaimingNormal,Constant
import paddle.nn.functional as Ffrom ..registry import BACKBONESdef get_inplanes():return [64, 128, 256, 512]class SpatialConv(nn.Layer):"""Inter-temporal Object Interaction Module (IOI)"""def __init__(self, dim_in, dim_out, pos_dim=7):super(SpatialConv, self).__init__()self.short_conv = nn.Conv2D(dim_in, dim_out, kernel_size=3, stride=1, padding=1, groups=1)self.glo_conv = nn.Sequential(nn.Conv2D(dim_in, 16, kernel_size=3, stride=1, padding=1, groups=1),nn.BatchNorm2D(16), nn.ReLU(),nn.Conv2D(16, 16, kernel_size=7, stride=1, padding=3),nn.BatchNorm2D(16), nn.ReLU(),nn.Conv2D(16, dim_out, kernel_size=3, stride=1, padding=1, groups=1), nn.Sigmoid())self.pos_embed = self.create_parameter(shape=[1, 16, pos_dim, pos_dim], default_initializer=nn.initializer.KaimingNormal())def forward(self, x, param):x_short = self.short_conv(x)x = x * paramfor i in range(len(self.glo_conv)):if i == 3:_, _, H, W = x.shapeif self.pos_embed.shape[2] != H or self.pos_embed.shape[3] != W:pos_embed = F.interpolate(self.pos_embed, size=(H, W), mode='bilinear', align_corners=True)else:pos_embed = self.pos_embedx = x + pos_embedx = self.glo_conv[i](x)return x_short * xclass Conv2d(nn.Layer):"""Channel-Time Learning Module (CTL)"""def __init__(self,in_channels: int,out_channels: int,kernel_size: int,stride: int = 1,padding: int = 0,dilation: int = 1,groups: int = 1,bias: bool = True,padding_mode: str = 'zeros', pos_dim = 7):super(Conv2d, self).__init__()self.stride = strideself.param_conv = nn.Sequential(nn.AdaptiveAvgPool2D((1, 1)),nn.Conv2D(in_channels, in_channels, 1, stride=1, padding=1 // 2, bias_attr=False),nn.BatchNorm2D(in_channels),nn.ReLU(),nn.Conv2D(in_channels, in_channels, 1, bias_attr=False),nn.Sigmoid())self.temporal_conv = nn.Conv2D(in_channels=in_channels, out_channels=out_channels, kernel_size=kernel_size, stride=1, padding=padding, dilation=dilation, groups=groups, bias_attr=bias, padding_mode=padding_mode)self.spatial_conv = SpatialConv(dim_in=in_channels, dim_out=out_channels, pos_dim=pos_dim)def forward(self, x):param = self.param_conv(x)x = self.temporal_conv(param * x) + self.spatial_conv(x, param)return xdef conv3x3x3(in_planes, out_planes, stride=1, pos_dim=7):return Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, padding=0, bias=False, pos_dim=pos_dim)def conv1x1x1(in_planes, out_planes, stride=1):return nn.Conv2D(in_planes, out_planes, kernel_size=1, stride=stride, bias_attr=False)class BasicBlock(nn.Layer):"""Channel-Time Learning (CTL) Block"""expansion = 1def __init__(self, in_planes, planes, stride=1, shortcut_conv=None, pos_dim=7):super().__init__()self.conv1 = conv3x3x3(in_planes, planes, stride)self.bn1 = nn.BatchNorm2D(planes)self.relu = nn.ReLU()self.conv2 = conv3x3x3(planes, planes, pos_dim=pos_dim)self.bn2 = nn.BatchNorm2D(planes)self.shortcut_conv = shortcut_convself.stride = strideif stride != 1:self.downsample = nn.Sequential(nn.Conv2D(in_planes, in_planes, kernel_size=2, stride=2, groups=in_planes),nn.BatchNorm2D(in_planes))def forward(self, x):if self.stride != 1:x = self.downsample(x)residual = xout = self.conv1(x)out = self.bn1(out)out = self.relu(out)out = self.conv2(out)out = self.bn2(out)if self.shortcut_conv is not None:residual = self.shortcut_conv(x)out += residualout = self.relu(out)return outclass Bottleneck(nn.Layer):"""Channel-Time Learning (CTL) Block"""expansion = 4def __init__(self, in_planes, planes, stride=1, shortcut_conv=None, pos_dim=7):super().__init__()self.conv1 = conv1x1x1(in_planes, planes)self.bn1 = nn.BatchNorm2D(planes)self.conv2 = conv3x3x3(planes, planes, pos_dim=pos_dim)self.bn2 = nn.BatchNorm2D(planes)self.conv3 = conv1x1x1(planes, planes * self.expansion)self.bn3 = nn.BatchNorm2D(planes * self.expansion)self.relu = nn.ReLU()self.shortcut_conv = shortcut_convself.stride = strideif stride != 1:self.downsample = nn.Sequential(nn.Conv2D(in_planes, in_planes, kernel_size=2, stride=2, groups=in_planes),nn.BatchNorm2D(in_planes))def forward(self, x):if self.stride != 1:x = self.downsample(x)residual = xout = self.conv1(x)out = self.bn1(out)out = self.relu(out)out = self.conv2(out)out = self.bn2(out)out = self.relu(out)out = self.conv3(out)out = self.bn3(out)if self.shortcut_conv is not None:residual = self.shortcut_conv(x)out += residualout = self.relu(out)return outclass ResNet(nn.Layer):def __init__(self,block,layers,block_inplanes,n_input_channels=3,no_max_pool=False,shortcut_type='B',widen_factor=1.0,dropout=0.2, freeze_bn=False, spatial_stride=[1,2,2,2], pos_dim=[64,32,16,8]):super().__init__()self.freeze_bn = freeze_bnblock_inplanes = [int(x * widen_factor) for x in block_inplanes]self.in_planes = block_inplanes[0]self.no_max_pool = no_max_poolself.dropout = dropoutself.conv1 = nn.Conv2D(n_input_channels,self.in_planes,kernel_size=5,stride=2,padding=2,groups=1,bias_attr=False)self.bn1 = nn.BatchNorm2D(self.in_planes)self.relu = nn.ReLU()self.maxpool = nn.MaxPool2D(kernel_size=3, stride=2, padding=1)self.layer1 = self._make_layer(block, block_inplanes[0], layers[0],shortcut_type, stride=spatial_stride[0], pos_dim=pos_dim[0])self.layer2 = self._make_layer(block,block_inplanes[1],layers[1],shortcut_type,stride=spatial_stride[1], pos_dim=pos_dim[1])self.layer3 = self._make_layer(block,block_inplanes[2],layers[2],shortcut_type,stride=spatial_stride[2], pos_dim=pos_dim[2])self.layer4 = self._make_layer(block,block_inplanes[3],layers[3],shortcut_type,stride=spatial_stride[3], pos_dim=pos_dim[3])def _downsample_basic_block(self, x, planes, stride):out = F.avg_pool2d(x, kernel_size=1, stride=stride)zero_pads = paddle.zeros([out.shape[0], planes - out.shape[1], out.shape[2], out.shape[3]])if isinstance(out, paddle.CUDAPlace):zero_pads = zero_pads.cuda()out = paddle.concat([out, zero_pads], axis=1)return outdef _make_layer(self, block, planes, blocks, shortcut_type, stride=1, pos_dim=7):shortcut = Noneif self.in_planes != planes * block.expansion:shortcut = nn.Sequential(conv1x1x1(self.in_planes, planes * block.expansion, stride=1),nn.BatchNorm2D(planes * block.expansion))layers = []layers.append(block(in_planes=self.in_planes,planes=planes,stride=stride, shortcut_conv=shortcut, pos_dim=pos_dim))self.in_planes = planes * block.expansionfor i in range(1, blocks):layers.append(block(self.in_planes, planes, pos_dim=pos_dim))return nn.Sequential(*layers)def forward(self, x):print('##################', x.shape)if len(x.shape) == 3:x = paddle.unsqueeze(x, axis=0)N, C, H, W = x.shapex = x.reshape([int(N/16), -1, H, W])x = self.conv1(x)x = self.bn1(x)x = self.relu(x)if not self.no_max_pool:x = self.maxpool(x)x = self.layer1(x)x = self.layer2(x)x = self.layer3(x)x = self.layer4(x)return xdef train(self, mode=True):freeze_bn = self.freeze_bnfreeze_bn_affine = self.freeze_bnsuper(ResNet, self).train(mode)if freeze_bn:print("Freezing Mean/Var of BatchNorm2D.")for m in self.sublayers():if isinstance(m, nn.BatchNorm2D):m.eval()if freeze_bn_affine:print("Freezing Weight/Bias of BatchNorm2D.")for m in self.sublayers():if isinstance(m, nn.BatchNorm2D):m.weight.stop_gradient = Truem.bias.stop_gradient = Truedef SqueezeTime_model(**kwargs):model = ResNet(Bottleneck, [2, 2, 2, 2], get_inplanes(), **kwargs)return model@BACKBONES.register()
def SqueezeTime(pretrained=None, use_ssld=False, **kwargs):"""Build SqueezeTime Model"""model = SqueezeTime_model(widen_factor=0.5, dropout=0.5, n_input_channels=48, freeze_bn=False, spatial_stride=[1, 2, 2, 2], pos_dim=[64, 32, 16, 8])return  model

2:导入backbone:

paddlevideo/modeling/backbones/__init__.py

# Copyright (c) 2020  PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.from .actbert import BertForMultiModalPreTraining
from .adds import ADDS_DepthNet
from .agcn import AGCN
from .asrf import ASRF
from .bmn import BMN
from .cfbi import CFBI
from .movinet import MoViNet
from .ms_tcn import MSTCN
from .resnet import ResNet
from .resnet_slowfast import ResNetSlowFast
from .resnet_slowfast_MRI import ResNetSlowFast_MRI
from .resnet_tsm import ResNetTSM
from .resnet_tsm_MRI import ResNetTSM_MRI
from .resnet_tsn_MRI import ResNetTSN_MRI
from .resnet_tweaks_tsm import ResNetTweaksTSM
from .resnet_tweaks_tsn import ResNetTweaksTSN
from .stgcn import STGCN
from .swin_transformer import SwinTransformer3D
from .transnetv2 import TransNetV2
from .vit import VisionTransformer
from .vit_tweaks import VisionTransformer_tweaks
from .ms_tcn import MSTCN
from .asrf import ASRF
from .resnet_tsn_MRI import ResNetTSN_MRI
from .resnet_tsm_MRI import ResNetTSM_MRI
from .resnet_slowfast_MRI import ResNetSlowFast_MRI
from .cfbi import CFBI
from .ctrgcn import CTRGCN
from .agcn2s import AGCN2s
from .movinet import MoViNet
from .resnet3d_slowonly import ResNet3dSlowOnly
from .toshift_vit import TokenShiftVisionTransformer
from .pptsm_mv2 import PPTSM_MobileNetV2
from .pptsm_mv3 import PPTSM_MobileNetV3
from .pptsm_v2 import PPTSM_v2
from .yowo import YOWO
from .squeezetime import SqueezeTime__all__ = ['ResNet', 'ResNetTSM', 'ResNetTweaksTSM', 'ResNetSlowFast', 'BMN','ResNetTweaksTSN', 'VisionTransformer', 'STGCN', 'AGCN', 'TransNetV2','ADDS_DepthNet', 'VisionTransformer_tweaks', 'BertForMultiModalPreTraining','ResNetTSN_MRI', 'ResNetTSM_MRI', 'ResNetSlowFast_MRI', 'CFBI', 'MSTCN','ASRF', 'MoViNet', 'SwinTransformer3D', 'CTRGCN','TokenShiftVisionTransformer', 'AGCN2s', 'PPTSM_MobileNetV2','PPTSM_MobileNetV3', 'PPTSM_v2', 'ResNet3dSlowOnly', 'YOWO', 'SqueezeTime'
]

3:添加head:

paddlevideo/modeling/heads/i2d_head.py

# Copyright (c) 2020  PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.import paddle
import paddle.nn as nn
from paddle import ParamAttrfrom ..registry import HEADS
from ..weight_init import weight_init_
from .base import BaseHead@HEADS.register()
class I2DHead(BaseHead):"""Classification head for I2D.Args:num_classes (int): Number of classes to be classified.in_channels (int): Number of channels in input feature.loss_cls (dict): Config for building loss.Default: dict(name='CrossEntropyLoss')spatial_type (str): Pooling type in spatial dimension. Default: 'avg'.drop_ratio (float): Probability of dropout layer. Default: 0.5.std (float): Std value for Initiation. Default: 0.01.kwargs (dict, optional): Any keyword argument to be used to initializethe head."""def __init__(self,num_classes,in_channels,loss_cfg=dict(name='CrossEntropyLoss'),spatial_type='avg',drop_ratio=0.5,std=0.01,**kwargs):super().__init__(num_classes, in_channels, loss_cfg, **kwargs)self.spatial_type = spatial_typeself.dropout_ratio = drop_ratioself.init_std = stdif self.dropout_ratio != 0:self.dropout = nn.Dropout(p=self.dropout_ratio)else:self.dropout = Noneself.fc_cls = nn.Linear(self.in_channels, self.num_classes)if self.spatial_type == 'avg':self.avg_pool = nn.AdaptiveAvgPool2D((1, 1))else:self.avg_pool = nn.AdaptiveMaxPool2D((1,1))def forward(self, x, num_segs = None):"""Defines the computation performed at every call.Args:x (Tensor): The input data.Returns:Tensor: The classification scores for input samples."""   # [N, in_channels, 4, 7, 7]if self.avg_pool is not None:x = self.avg_pool(x)# [N, in_channels, 1, 1, 1]if self.dropout is not None:x = self.dropout(x)# [N, in_channels, 1, 1, 1]x = paddle.reshape(x, [x.shape[0], -1])# [N, in_channels]cls_score = self.fc_cls(x)# [N, num_classes]return cls_score# def forward_new(self, x, num_segs = None):#     """Defines the computation performed at every call.#     Args:#         x (Tensor): The input data.#     Returns:#         Tensor: The classification scores for input samples.#     """      #     # [N, in_channels, 4, 7, 7]#     if self.avg_pool is not None:#         x = self.avg_pool(x)#     # [N, in_channels, 1, 1, 1]#     if self.dropout is not None:#         x = self.dropout(x)#     # [N, in_channels, 1, 1, 1]#     x = paddle.reshape(x, [x.shape[0], -1])#     # [N, in_channels]#     cls_score = self.fc_cls(x)#     # [N, num_classes]#     return cls_score

4:导入head:

paddlevideo/modeling/heads/__init__.py

# Copyright (c) 2020  PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.from .adds_head import AddsHead
from .asrf_head import ASRFHead
from .attention_lstm_head import AttentionLstmHead, ActionAttentionLstmHead
from .base import BaseHead
from .bbox_head import BBoxHeadAVA
from .cfbi_head import CollaborativeEnsemblerMS
from .i3d_head import I3DHead
from .movinet_head import MoViNetHead
from .ms_tcn_head import MSTCNHead
from .pptimesformer_head import ppTimeSformerHead
from .pptsm_head import ppTSMHead
from .pptsn_head import ppTSNHead
from .roi_head import AVARoIHead
from .single_straight3d import SingleRoIExtractor3D
from .slowfast_head import SlowFastHead
from .stgcn_head import STGCNHead
from .timesformer_head import TimeSformerHead
from .transnetv2_head import TransNetV2Head
from .tsm_head import TSMHead
from .tsn_head import TSNHead
from .ms_tcn_head import MSTCNHead
from .asrf_head import ASRFHead
from .ctrgcn_head import CTRGCNHead
from .movinet_head import MoViNetHead
from .agcn2s_head import AGCN2sHead
from .token_shift_head import TokenShiftHead
from .i2d_head import I2DHead__all__ = ['BaseHead', 'TSNHead', 'TSMHead', 'ppTSMHead', 'ppTSNHead', 'SlowFastHead','AttentionLstmHead', 'TimeSformerHead', 'STGCNHead', 'TransNetV2Head','I3DHead', 'SingleRoIExtractor3D', 'AVARoIHead', 'BBoxHeadAVA', 'AddsHead','ppTimeSformerHead', 'CollaborativeEnsemblerMS', 'MSTCNHead', 'ASRFHead','MoViNetHead', 'CTRGCNHead', 'TokenShiftHead', 'ActionAttentionLstmHead','AGCN2sHead', 'I2DHead'
]

5:训练配置文件:

configs/recognition/pptsm/v2/md_ppsqt_16frames_uniform.yaml

MODEL: #MODEL fieldframework: "Recognizer2D" #Mandatory, indicate the type of network, associate to the 'paddlevideo/modeling/framework/' .backbone: #Mandatory, indicate the type of backbone, associate to the 'paddlevideo/modeling/backbones/' .name: "SqueezeTime" #Mandatory, The name of backbone.head:name: "I2DHead" #Mandatory, indicate the type of head, associate to the 'paddlevideo/modeling/heads'#pretrained: "" #Optional, pretrained model path.num_classes: 2in_channels: 1024DATASET: #DATASET fieldbatch_size: 16  #Mandatory, bacth sizenum_workers: 4 #Mandatory, the number of subprocess on each GPU.train:format: "FrameDataset" #Mandatory, indicate the type of dataset, associate to the 'paddlevidel/loader/dateset'data_prefix: "/home/mnt/sdd/Data/data_fights/rawframes" #Mandatory, train data root pathfile_path: "/home/mnt/sdd/Data/data_fights/train_list.txt" #Mandatory, train data index file pathsuffix: 'img_{:06}.jpg'valid:format: "FrameDataset" #Mandatory, indicate the type of dataset, associate to the 'paddlevidel/loader/dateset'data_prefix: "/home/mnt/sdd/Data/data_fights/rawframes" #Mandatory, valid data root pathfile_path: "/home/mnt/sdd/Data/data_fights/test_list.txt" #Mandatory, valid data index file pathsuffix: 'img_{:06}.jpg'test:format: "FrameDataset" #Mandatory, indicate the type of dataset, associate to the 'paddlevidel/loader/dateset'data_prefix: "/home/mnt/sdd/Data/data_fights/rawframes" #Mandatory, valid data root pathfile_path: "/home/mnt/sdd/Data/data_fights/test_list.txt" #Mandatory, valid data index file pathsuffix: 'img_{:06}.jpg'PIPELINE: #PIPELINE fieldtrain: #Mandotary, indicate the pipeline to deal with the training data, associate to the 'paddlevideo/loader/pipelines/'decode:name: "FrameDecoder"sample:name: "Sampler"num_seg: 16seg_len: 1valid_mode: Falsetransform: #Mandotary, image transfrom operator- Scale:short_size: 256- MultiScaleCrop:target_size: 256- RandomCrop:target_size: 224- RandomFlip:- Image2Array:- Normalization:mean: [0.485, 0.456, 0.406]std: [0.229, 0.224, 0.225]valid: #Mandatory, indicate the pipeline to deal with the validing data. associate to the 'paddlevideo/loader/pipelines/'decode:name: "FrameDecoder"sample:name: "Sampler"num_seg: 16seg_len: 1valid_mode: Truetransform:- Scale:short_size: 256- CenterCrop:target_size: 224- Image2Array:- Normalization:mean: [0.485, 0.456, 0.406]std: [0.229, 0.224, 0.225]test:  #Mandatory, indicate the pipeline to deal with the validing data. associate to the 'paddlevideo/loader/pipelines/'decode:name: "FrameDecoder"sample:name: "Sampler"num_seg: 16seg_len: 1valid_mode: Truetransform:- Scale:short_size: 256- CenterCrop:target_size: 224- Image2Array:- Normalization:mean: [0.485, 0.456, 0.406]std: [0.229, 0.224, 0.225]OPTIMIZER: #OPTIMIZER fieldname: 'Momentum'momentum: 0.9learning_rate:iter_step: Truename: 'CustomWarmupCosineDecay'max_epoch: 120warmup_epochs: 10warmup_start_lr: 0.005cosine_base_lr: 0.01weight_decay:name: 'L2'value: 1e-4use_nesterov: TrueMIX:name: "Mixup"alpha: 0.2METRIC:name: 'CenterCropMetric'INFERENCE:name: 'ppSQT_Inference_helper'num_seg: 16target_size: 224model_name: "ppSQT"
log_interval: 10 #Optional, the interal of logger, default:10
epochs: 120  #Mandatory, total epoch
log_level: "INFO" #Optional, the logger level. default: "INFO"

6:训练:

# multi-gpu-st
export CUDA_VISIBLE_DEVICES=0,1
python -B -m paddle.distributed.launch --gpus="0,1"  --log_dir=./log/log_sqt_frame_16  main.py  --validate -c configs/recognition/pptsm/v2/ppsqt_lcnet_md_16frames_uniform.yaml

7:结果:精度比ppTSM-v2低8个点左右。有可能是没有预训练权重的问题。 

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

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

相关文章

分类模型的算法性能评价

一、概述 分类模型是机器学习中一种最常见的问题模型,在许多问题场景中有着广泛的运用,是模式识别问题中一种主要的实现手段。分类问题概况起来就是,对一堆高度抽象了的样本,由经验标定了每个样本所属的实际类别,由特定…

List、Map、Set 接口在Java中的存取元素特点

List、Map、Set 接口在Java中的存取元素特点 1、List 接口2、Map 接口3、Set 接口4、总结 💖The Begin💖点点关注,收藏不迷路💖 在Java中,List、Map和Set是三个最常用的集合接口。它们各自有不同的特点和用途&#xff…

Windows 网络重置及重置网络可能出现的问题( WIFI 没有了 / WLAN 图标消失)

netsh int ip reset 命令是用于重置 Windows 操作系统中的网络设置和配置的命令。 在网络故障排除、修复网络连接问题以及清除可能存在的网络配置冲突时非常有用。 命令详解: netsh: 用于配置各种网络设置 int: 用于管理网络接口 ip: 用于管理网络接口的 IP 配…

我的FPGA

1.安装quartus 2.更新usb blaster驱动 3.新建工程 1.随便找一个文件夹,里面新建demo文件夹,表示一个个工程 在demo文件夹里面,新建src(源码),prj(项目),doc&#xff…

LLM 研究方向(一): LLM Prompts--p-tuning、LoRA

目录 1. prompt-tuning background 2. Prompt Tuning 模型介绍 2.1 2021 prefix-tuning 2.2 2021 P-tuning v1 2.3 2021 Parameter-efficient prompt tuning (PET) 2.4 2022 P-tuning v2 2.5 2019 Adapter ​2.6 2021 LoRA (Low-Rank Adaptation) 2.7 2024 DoRA (…

VS Code 配置 C/C++ 编程运行环境(保姆级教程)

文章目录 一、软件下载1. 下载 VS Code 安装工具 2. 下载 MinGW-W64二、安装 VS Code三、安装 MinGW-W64 及配置环境变量四、配置 VS Code 的 C/C 编程运行环境1. 汉化 VS Code(选做)2. 安装 C/C 扩展包 五、测试 VS Code 的 C/C 编程环境1. 创建代码文件…

PowerShell install 一键部署mysql 9.0.0

mysql 前言 MySQL 是一个基于 SQL(Structured Query Language)的数据库系统,SQL 是一种用于访问和管理数据库的标准语言。MySQL 以其高性能、稳定性和易用性而闻名,它被广泛应用于各种场景,包括: Web 应用程序:许多动态网站和内容管理系统(如 WordPress)使用 MySQL 存…

14-65 剑和诗人39 - 打造你自己的 Devin

​​​​​ 绝密 Devin 架构 更具体地说,构建您自己的 AI 代理。 Devin 使用 GPT-4 ,而人们已经开始用 Claude-3-Opus 构建替代方案 Devin 的 UI 体验更好。 例如,它甚至看不到浏览器,但它确实存在于用户面前 此外,你可以随时与它“交谈”,就像与人交谈一样,它会在后…

基于单片机的温湿度感应智能晾衣杆系统设计

[摘 要] 本设计拟开发一种湿度感应智能晾衣杆系统 , 此新型晾衣杆是以单片机为主控芯片 来控制的实时检测系统 . 该系统使用 DHT11 温湿度传感器来检测大气的温湿度 , 然后通过单 片机处理信息来控制 28BYJ &…

Linux——多线程(五)

1.线程池 1.1初期框架 thread.hpp #include<iostream> #include <string> #include <unistd.h> #include <functional> #include <pthread.h>namespace ThreadModule {using func_t std::function<void()>;class Thread{public:void E…

申请商标用什么颜色:企业和个人申请注册商标攻略!

在申请注册商标到底要用什么颜色&#xff0c;许多初次申请注册主体都不是特别清楚&#xff0c;普推知产商标老杨建议&#xff0c;在一般情况下建议尽量用黑白色&#xff0c;因为商标用黑白色在使用时可以着任何色。 在用黑色申请注册成功&#xff0c;别的主体用其它颜色要在同…

区域特征检测工具的使用

区域特征检测工具的使用 选择区域-》右键-》工具->特征检测

C 语言中如何进行冒泡排序?

&#x1f345;关注博主&#x1f397;️ 带你畅游技术世界&#xff0c;不错过每一次成长机会&#xff01; &#x1f4d9;C 语言百万年薪修炼课程 通俗易懂&#xff0c;深入浅出&#xff0c;匠心打磨&#xff0c;死磕细节&#xff0c;6年迭代&#xff0c;看过的人都说好。 文章目…

华为od100问持续分享-1

我是一名软件开发培训机构老师&#xff0c;我的学生已经有上百人通过了华为OD机试&#xff0c;学生们每次考完试&#xff0c;会把题目拿出来一起交流分享。 重要&#xff1a;2024年5月份开始&#xff0c;考的都是OD统一考试&#xff08;D卷&#xff09;&#xff0c;题库已经整…

CentOS6用文件配置IP模板

CentOS6用文件配置IP模板 到 CentOS6.9 , 默认还不能用 systemctl , 能用 service chkconfig sshd on 对应 systemctl enable sshd 启用,开机启动该服务 ### chkconfig sshd on 对应 systemctl enable sshd 启用,开机启动该服务 sudo chkconfig sshd onservice sshd start …

grep对文件内容搜索(附重要拓展-正则表达式)

文件搜索是搜索查找符合条件的某文件的目录&#xff0c;若要编辑文件或对文件的某配置进行修改&#xff0c;就需要对文件内容进行搜索。 grep 命令是 Linux 及类 Unix 操作系统中的一个强大的文本搜索工具&#xff0c;用于搜索一个或多个文件中匹配给定模式的行。grep 代表“Gl…

Linux进程管理Part2

Linux进程控制Part2 文章目录 Linux进程控制Part2Fork()函数详解简单描述 fork函数的使用进程退出的方式_exit函数exit函数return 退出 进程等待进程等待的方法 kill的使用进程替换简单描述命名原理 END Fork()函数详解 FORK(2) Linux Programmer’s Manual FORK(2) NAME for…

53-4 内网代理6 - frp搭建三层代理

前提:53-3 内网代理5 - frp搭建二级代理-CSDN博客 三级网络代理 在办公区入侵后,发现需要进一步渗透核心区网络(192.168.60.0/24),并登录域控制器的远程桌面。使用FRP在EDMZ区、办公区与核心区之间建立三级网络的SOCKS5代理,以便访问核心区的域控制器。 VPS上的FRP服…

科研训练课程2--论文格式修改+endnote使用

科研训练课程2–论文格式修改endnote使用 文章目录 前言修改论文格式图表endnote 使用&#xff08;补充&#xff09; 总结 前言 第二天 2024/7/9 所属目录&#xff1a;科研训练课程创建时间&#xff1a;2024/7/9作者&#xff1a;星云<XingYun>更新时间&#xff1a;xxxUR…

[高频 SQL 50 题(基础版)]第一千七百五十七题,可回收且低脂产品

题目&#xff1a; 表&#xff1a;Products ---------------------- | Column Name | Type | ---------------------- | product_id | int | | low_fats | enum | | recyclable | enum | ---------------------- product_id 是该表的主键&#xff08;具有唯…