caffe搭建squeezenet网络的整套工程
之前用pytorch构建了squeezenet,个人觉得pytorch是最好用的,但是有的工程就是需要caffe结构的,所以本篇也用caffe构建一个squeezenet网络。
数据处理
首先要对数据进行处理,跟pytorch不同,pytorch读取数据只需要给数据集所在目录即可直接从中读取数据,而caffe需要一个包含每张图片的绝对路径以及所在类别的txt文件,从中读取数据。写一个生成次txt文件的脚本:
import os
import randomfolder = 'cotta' # 数据集目录相对路径
names = os.listdir(folder)f1 = open('/train_txt/train_cotta.txt', 'a') # 生成的txt地址
f2 = open('/train_txt/test_water_workcloth.txt', 'a')for name in names:imgnames = os.listdir(folder + '/' + name)random.shuffle(imgnames)numimg = len(imgnames)for i in range(numimg):f1.write('%s %s\n' % (folder + '/' + name + '/' + imgnames[i], name[0]))# if i < int(0.9*numimg):# f1.write('%s %s\n'%(folder + '/' + name + '/' + imgnames[i], name[0]))# else:# f2.write('%s %s\n'%(folder + '/' + name + '/' + imgnames[i], name[0]))
# f2.close()
f1.close()
数据集的目录也要跟pytorch的一致,一个类的数据放在一个目录中,目录名为类名。且脚本与该目录同级。
运行脚本后生成的txt内容如下:
/cotta/0_other/0_1_391_572_68_68.jpg 0
/cotta/1_longSleeves/9605_1_5_565_357_82_70.jpg 1
/cotta/2_cotta/713_0.99796_1_316_162_96_87.jpg 2
......
图片相对路径 图片所属类别
网络结构配置文件
trainval.prototxt
layer {name: "data"type: "ImageData"top: "data"top: "label"transform_param {mirror: truecrop_size: 96}image_data_param {source: "/train_txt/train_cotta.txt" # 生成的txt的相对路径root_folder: "/data/" # 存放数据集目录的路径batch_size: 64shuffle: truenew_height: 96new_width: 96}}
layer {name: "conv1"type: "Convolution"bottom: "data"top: "conv1"convolution_param {num_output: 96kernel_size: 3stride: 1pad: 1weight_filler {type: "xavier"}}
}layer { name: "BatchNorm1" type: "BatchNorm" bottom: "conv1" top: "BatchNorm1"
}layer {name: "relu_conv1"type: "ReLU"bottom: "BatchNorm1"top: "BatchNorm1"
}
layer {name: "pool1"type: "Pooling"bottom: "BatchNorm1"top: "pool1"pooling_param {pool: MAXkernel_size: 2stride: 2}
}
layer {name: "fire2/squeeze1x1"type: "Convolution"bottom: "pool1"top: "fire2/squeeze1x1"convolution_param {num_output: 16kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire2/bn_squeeze1x1" type: "BatchNorm" bottom: "fire2/squeeze1x1" top: "fire2/bn_squeeze1x1"
}layer {name: "fire2/relu_squeeze1x1"type: "ReLU"bottom: "fire2/bn_squeeze1x1"top: "fire2/bn_squeeze1x1"
}
layer {name: "fire2/expand1x1"type: "Convolution"bottom: "fire2/bn_squeeze1x1"top: "fire2/expand1x1"convolution_param {num_output: 64kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire2/bn_expand1x1" type: "BatchNorm" bottom: "fire2/expand1x1" top: "fire2/bn_expand1x1"
}layer {name: "fire2/relu_expand1x1"type: "ReLU"bottom: "fire2/bn_expand1x1"top: "fire2/bn_expand1x1"
}
layer {name: "fire2/expand3x3"type: "Convolution"bottom: "fire2/bn_expand1x1"top: "fire2/expand3x3"convolution_param {num_output: 64pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire2/bn_expand3x3" type: "BatchNorm" bottom: "fire2/expand3x3" top: "fire2/bn_expand3x3"
}layer {name: "fire2/relu_expand3x3"type: "ReLU"bottom: "fire2/bn_expand3x3"top: "fire2/bn_expand3x3"
}
layer {name: "fire2/concat"type: "Concat"bottom: "fire2/bn_expand1x1"bottom: "fire2/bn_expand3x3"top: "fire2/concat"
}#fire2 ends: 128 channels
layer {name: "fire3/squeeze1x1"type: "Convolution"bottom: "fire2/concat"top: "fire3/squeeze1x1"convolution_param {num_output: 16kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire3/bn_squeeze1x1" type: "BatchNorm" bottom: "fire3/squeeze1x1" top: "fire3/bn_squeeze1x1"
}layer {name: "fire3/relu_squeeze1x1"type: "ReLU"bottom: "fire3/bn_squeeze1x1"top: "fire3/bn_squeeze1x1"
}
layer {name: "fire3/expand1x1"type: "Convolution"bottom: "fire3/bn_squeeze1x1"top: "fire3/expand1x1"convolution_param {num_output: 64kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire3/bn_expand1x1" type: "BatchNorm" bottom: "fire3/expand1x1" top: "fire3/bn_expand1x1"
}layer {name: "fire3/relu_expand1x1"type: "ReLU"bottom: "fire3/bn_expand1x1"top: "fire3/bn_expand1x1"
}
layer {name: "fire3/expand3x3"type: "Convolution"bottom: "fire3/bn_expand1x1"top: "fire3/expand3x3"convolution_param {num_output: 64pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire3/bn_expand3x3" type: "BatchNorm" bottom: "fire3/expand3x3" top: "fire3/bn_expand3x3"
}layer {name: "fire3/relu_expand3x3"type: "ReLU"bottom: "fire3/bn_expand3x3"top: "fire3/bn_expand3x3"
}
layer {name: "fire3/concat"type: "Concat"bottom: "fire3/bn_expand1x1"bottom: "fire3/bn_expand3x3"top: "fire3/concat"
}#fire3 ends: 128 channelslayer {name: "bypass_23"type: "Eltwise"bottom: "fire2/concat"bottom: "fire3/concat"top: "fire3_EltAdd"
}layer {name: "fire4/squeeze1x1"type: "Convolution"bottom: "fire3_EltAdd"top: "fire4/squeeze1x1"convolution_param {num_output: 32kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire4/bn_squeeze1x1" type: "BatchNorm" bottom: "fire4/squeeze1x1" top: "fire4/bn_squeeze1x1"
}layer {name: "fire4/relu_squeeze1x1"type: "ReLU"bottom: "fire4/bn_squeeze1x1"top: "fire4/bn_squeeze1x1"
}
layer {name: "fire4/expand1x1"type: "Convolution"bottom: "fire4/bn_squeeze1x1"top: "fire4/expand1x1"convolution_param {num_output: 128kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire4/bn_expand1x1" type: "BatchNorm" bottom: "fire4/expand1x1" top: "fire4/bn_expand1x1"
}layer {name: "fire4/relu_expand1x1"type: "ReLU"bottom: "fire4/bn_expand1x1"top: "fire4/bn_expand1x1"
}
layer {name: "fire4/expand3x3"type: "Convolution"bottom: "fire4/bn_expand1x1"top: "fire4/expand3x3"convolution_param {num_output: 128pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire4/bn_expand3x3" type: "BatchNorm" bottom: "fire4/expand3x3" top: "fire4/bn_expand3x3"
}layer {name: "fire4/relu_expand3x3"type: "ReLU"bottom: "fire4/bn_expand3x3"top: "fire4/bn_expand3x3"
}
layer {name: "fire4/concat"type: "Concat"bottom: "fire4/bn_expand1x1"bottom: "fire4/bn_expand3x3"top: "fire4/concat"
}
#fire4 ends: 256 channelslayer {name: "pool4"type: "Pooling"bottom: "fire4/concat"top: "pool4"pooling_param {pool: MAXkernel_size: 2stride: 2}
}
#fire4 ends: 256 channels / pooled
layer {name: "fire5/squeeze1x1"type: "Convolution"bottom: "pool4"top: "fire5/squeeze1x1"convolution_param {num_output: 32kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire5/bn_squeeze1x1" type: "BatchNorm" bottom: "fire5/squeeze1x1" top: "fire5/bn_squeeze1x1"
}layer {name: "fire5/relu_squeeze1x1"type: "ReLU"bottom: "fire5/bn_squeeze1x1"top: "fire5/bn_squeeze1x1"
}
layer {name: "fire5/expand1x1"type: "Convolution"bottom: "fire5/bn_squeeze1x1"top: "fire5/expand1x1"convolution_param {num_output: 128kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire5/bn_expand1x1" type: "BatchNorm" bottom: "fire5/expand1x1" top: "fire5/bn_expand1x1"
}layer {name: "fire5/relu_expand1x1"type: "ReLU"bottom: "fire5/bn_expand1x1"top: "fire5/bn_expand1x1"
}
layer {name: "fire5/expand3x3"type: "Convolution"bottom: "fire5/bn_expand1x1"top: "fire5/expand3x3"convolution_param {num_output: 128pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire5/bn_expand3x3" type: "BatchNorm" bottom: "fire5/expand3x3" top: "fire5/bn_expand3x3"
}layer {name: "fire5/relu_expand3x3"type: "ReLU"bottom: "fire5/bn_expand3x3"top: "fire5/bn_expand3x3"
}
layer {name: "fire5/concat"type: "Concat"bottom: "fire5/bn_expand1x1"bottom: "fire5/bn_expand3x3"top: "fire5/concat"
}#fire5 ends: 256 channels
layer {name: "bypass_45"type: "Eltwise"bottom: "pool4"bottom: "fire5/concat"top: "fire5_EltAdd"
}layer {name: "fire6/squeeze1x1"type: "Convolution"bottom: "fire5_EltAdd"top: "fire6/squeeze1x1"convolution_param {num_output: 48kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire6/bn_squeeze1x1" type: "BatchNorm" bottom: "fire6/squeeze1x1" top: "fire6/bn_squeeze1x1"
}layer {name: "fire6/relu_squeeze1x1"type: "ReLU"bottom: "fire6/bn_squeeze1x1"top: "fire6/bn_squeeze1x1"
}
layer {name: "fire6/expand1x1"type: "Convolution"bottom: "fire6/bn_squeeze1x1"top: "fire6/expand1x1"convolution_param {num_output: 192kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire6/bn_expand1x1" type: "BatchNorm" bottom: "fire6/expand1x1" top: "fire6/bn_expand1x1"
}layer {name: "fire6/relu_expand1x1"type: "ReLU"bottom: "fire6/bn_expand1x1"top: "fire6/bn_expand1x1"
}
layer {name: "fire6/expand3x3"type: "Convolution"bottom: "fire6/bn_expand1x1"top: "fire6/expand3x3"convolution_param {num_output: 192pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire6/bn_expand3x3" type: "BatchNorm" bottom: "fire6/expand3x3" top: "fire6/bn_expand3x3"
}layer {name: "fire6/relu_expand3x3"type: "ReLU"bottom: "fire6/bn_expand3x3"top: "fire6/bn_expand3x3"
}
layer {name: "fire6/concat"type: "Concat"bottom: "fire6/bn_expand1x1"bottom: "fire6/bn_expand3x3"top: "fire6/concat"
}
#fire6 ends: 384 channelslayer {name: "fire7/squeeze1x1"type: "Convolution"bottom: "fire6/concat"top: "fire7/squeeze1x1"convolution_param {num_output: 48kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire7/bn_squeeze1x1" type: "BatchNorm" bottom: "fire7/squeeze1x1" top: "fire7/bn_squeeze1x1"
}layer {name: "fire7/relu_squeeze1x1"type: "ReLU"bottom: "fire7/bn_squeeze1x1"top: "fire7/bn_squeeze1x1"
}
layer {name: "fire7/expand1x1"type: "Convolution"bottom: "fire7/bn_squeeze1x1"top: "fire7/expand1x1"convolution_param {num_output: 192kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire7/bn_expand1x1" type: "BatchNorm" bottom: "fire7/expand1x1" top: "fire7/bn_expand1x1"
}layer {name: "fire7/relu_expand1x1"type: "ReLU"bottom: "fire7/bn_expand1x1"top: "fire7/bn_expand1x1"
}
layer {name: "fire7/expand3x3"type: "Convolution"bottom: "fire7/bn_expand1x1"top: "fire7/expand3x3"convolution_param {num_output: 192pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire7/bn_expand3x3" type: "BatchNorm" bottom: "fire7/expand3x3" top: "fire7/bn_expand3x3"
}layer {name: "fire7/relu_expand3x3"type: "ReLU"bottom: "fire7/bn_expand3x3"top: "fire7/bn_expand3x3"
}
layer {name: "fire7/concat"type: "Concat"bottom: "fire7/bn_expand1x1"bottom: "fire7/bn_expand3x3"top: "fire7/concat"
}
#fire7 ends: 384 channels
layer {name: "bypass_67"type: "Eltwise"bottom: "fire6/concat"bottom: "fire7/concat"top: "fire7_EltAdd"
}layer {name: "fire8/squeeze1x1"type: "Convolution"bottom: "fire7_EltAdd"top: "fire8/squeeze1x1"convolution_param {num_output: 64kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire8/bn_squeeze1x1" type: "BatchNorm" bottom: "fire8/squeeze1x1" top: "fire8/bn_squeeze1x1"
}layer {name: "fire8/relu_squeeze1x1"type: "ReLU"bottom: "fire8/bn_squeeze1x1"top: "fire8/bn_squeeze1x1"
}
layer {name: "fire8/expand1x1"type: "Convolution"bottom: "fire8/bn_squeeze1x1"top: "fire8/expand1x1"convolution_param {num_output: 256kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire8/bn_expand1x1" type: "BatchNorm" bottom: "fire8/expand1x1" top: "fire8/bn_expand1x1"
}layer {name: "fire8/relu_expand1x1"type: "ReLU"bottom: "fire8/bn_expand1x1"top: "fire8/bn_expand1x1"
}
layer {name: "fire8/expand3x3"type: "Convolution"bottom: "fire8/bn_expand1x1"top: "fire8/expand3x3"convolution_param {num_output: 256pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire8/bn_expand3x3" type: "BatchNorm" bottom: "fire8/expand3x3" top: "fire8/bn_expand3x3"
}layer {name: "fire8/relu_expand3x3"type: "ReLU"bottom: "fire8/bn_expand3x3"top: "fire8/bn_expand3x3"
}
layer {name: "fire8/concat"type: "Concat"bottom: "fire8/bn_expand1x1"bottom: "fire8/bn_expand3x3"top: "fire8/concat"
}
#fire8 ends: 512 channelslayer {name: "pool8"type: "Pooling"bottom: "fire8/concat"top: "pool8"pooling_param {pool: MAXkernel_size: 2stride: 2}
}
#fire8 ends: 512 channels
layer {name: "fire9/squeeze1x1"type: "Convolution"bottom: "pool8"top: "fire9/squeeze1x1"convolution_param {num_output: 64kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire9/bn_squeeze1x1" type: "BatchNorm" bottom: "fire9/squeeze1x1" top: "fire9/bn_squeeze1x1"
}layer {name: "fire9/relu_squeeze1x1"type: "ReLU"bottom: "fire9/bn_squeeze1x1"top: "fire9/bn_squeeze1x1"
}
layer {name: "fire9/expand1x1"type: "Convolution"bottom: "fire9/bn_squeeze1x1"top: "fire9/expand1x1"convolution_param {num_output: 256kernel_size: 1weight_filler {type: "xavier"}}
}layer { name: "fire9/bn_expand1x1" type: "BatchNorm" bottom: "fire9/expand1x1" top: "fire9/bn_expand1x1"
}layer {name: "fire9/relu_expand1x1"type: "ReLU"bottom: "fire9/bn_expand1x1"top: "fire9/bn_expand1x1"
}
layer {name: "fire9/expand3x3"type: "Convolution"bottom: "fire9/bn_expand1x1"top: "fire9/expand3x3"convolution_param {num_output: 256pad: 1kernel_size: 3weight_filler {type: "xavier"}}
}layer { name: "fire9/bn_expand3x3" type: "BatchNorm" bottom: "fire9/expand3x3" top: "fire9/bn_expand3x3"
}layer {name: "fire9/relu_expand3x3"type: "ReLU"bottom: "fire9/bn_expand3x3"top: "fire9/bn_expand3x3"
}
layer {name: "fire9/concat"type: "Concat"bottom: "fire9/bn_expand1x1"bottom: "fire9/bn_expand3x3"top: "fire9/concat"
}
#fire9 ends: 512 channelslayer {name: "conv10_new"type: "Convolution"bottom: "fire9/concat"top: "conv10"convolution_param {num_output: 3kernel_size: 1weight_filler {type: "gaussian"mean: 0.0std: 0.01}}
}layer {name: "pool10"type: "Pooling"bottom: "conv10"top: "pool10"pooling_param {pool: AVEglobal_pooling: true}
}# loss, top1, top5
layer {name: "loss"type: "SoftmaxWithLoss"bottom: "pool10"bottom: "label"top: "loss"include {
# phase: TRAIN}
}
layer {name: "accuracy"type: "Accuracy"bottom: "pool10"bottom: "label"top: "accuracy"#include {# phase: TEST#}
}
在最后一层卷积层conv10中的num_output修改类别数量。
模型超参配置文件
solver.prototxt
test_iter: 2000 #not subject to iter_size
test_interval: 1000000
# base_lr: 0.0001
base_lr: 0.005 # 学习率
display: 40
# max_iter: 600000
max_iter: 200000 # 迭代数
iter_size: 2 #global batch size = batch_size * iter_size
lr_policy: "poly"
power: 1.0 #linearly decrease LR
momentum: 0.9
weight_decay: 0.0002
snapshot: 10000 # 每多少次迭代保存一个模型
snapshot_prefix: "/data/zxc/classfication/model/model_cotta/cotta_" # 模型保存路径
solver_mode: GPU
random_seed: 42
net: "./trainNets_drive/trainval.prototxt" # 网络结构配置文件的路径
test_initialization: false
average_loss: 40
- max_iter:caffe用的是迭代数而不是pytorch的轮数。pytorch中训练完全部的训练集为一轮,而caffe中训练完一个batch_size的数据为一个迭代。如果想要等价与轮数的话,一轮就等于:len(train_data) / batch_size。如果有余数就要看pytorch里的dataloader里面设置舍去还是为一个batch,如果舍去就是向下取整,如果不舍去就是向上取整;
- snapshot_prefix:最后一部分为每个保存模型的前缀,如图:
运行命令
将运行命令写入bash文件中:
train.sh
/home/seg/anaconda3/envs/zxc/bin/caffe train -gpu 1 -solver ./solvers/solver_3.prototxt -weights=/data/classfication/model/model_cotta/cotta__iter_200000.caffemodel 2>&1 | tee log_3_4_class.txt
- -gpu:选择哪块卡,如果就一块就是0;
- -solver:后面跟网络超参配置文件路径;
- -weights:后面跟预训练模型,可以用官方给的squeezenet的caffe版本的预训练模型,我这里是训练中断从断点继续训练
编写完成后source activate 环境名称
进入source环境,然后source train.sh
运行bash文件就能开始训练。
相关文章:

caffe搭建squeezenet网络的整套工程
之前用pytorch构建了squeezenet,个人觉得pytorch是最好用的,但是有的工程就是需要caffe结构的,所以本篇也用caffe构建一个squeezenet网络。 数据处理 首先要对数据进行处理,跟pytorch不同,pytorch读取数据只需要给数据…...
【OWT】梳理构建的webrtc和owt mfc工程
梳理构建的webrtc和owt mfc工程M98 + owtp2p : 发现最终基于m98的owt也可以直接跑通 【owt】p2p client mfc 工程梳理 服务端使用github版本。 本地运行调试即可。 M98 VS2017 构建 :只构建了m98的webrtc.lib 【webrtc】vs2017 重新构建m98 G:\webrtc_m98_yjf\src webrtc本身…...
02 powershell服务器远程执行命令
一、获取服务器登录凭证 $Username myft\xngrq $PWD 123!# #将密码加密成特殊的字符串对象 $pass ConvertTo-SecureString -AsPlainText $PWD -Force #创建一个登录凭证对象 $Cred New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass …...
LeetCode257. Binary Tree Paths
文章目录 一、题目二、题解 一、题目 Given the root of a binary tree, return all root-to-leaf paths in any order. A leaf is a node with no children. Example 1: Input: root [1,2,3,null,5] Output: [“1->2->5”,“1->3”] Example 2: Input: root […...

Linux下MSSQL (SQL Server)数据库无法启动故障处理
有同事反馈一套CentOS7下的mssql server2017无法启动需要我帮忙看看,启动报错情况如下 检查日志并没有更新日志信息 乍一看mssql-server服务有问题,检查mssql也确实没有进程 既然服务有问题,那么我们用一种方式直接手工后台启动mssql引擎来…...
2311极语言高亮说明书
入门 安装目录下Sec.exe为ide.Sc为编译器. .sec为单文件二进制源码结构,.SEC和.极为多文件文本结构,命令行:cmd Sc.exe 源码路径. 基础 整数变量也可以是万能指针,传送参数,参数只有整数和小数两种. 可在名称前面加或&符号取变量或函数名指针地址,文本变量只取地址不用加…...

金蝶云星空与金蝶云星空对接集成盘亏单查询打通盘亏单新增
金蝶云星空与金蝶云星空对接集成盘亏单查询打通盘亏单新增 接通系统:金蝶云星空 金蝶K/3Cloud(金蝶云星空)是移动互联网时代的新型ERP,是基于WEB2.0与云技术的新时代企业管理服务平台。金蝶K/3Cloud围绕着“生态、人人、体验”&am…...
深入理解 Django 信号机制
Django 信号(signals)是一种实现解耦的有力工具,它允许某些发生的事件通知其他部分的代码。信号主要用于在 Django 应用中的不同部分之间传递信息,尤其是在模型操作发生时。本文将深入探讨 Django 信号的工作原理、如何定义和接收…...

uniapp开发app应用从创建到上架
目录 前言 一、项目初始化 1.初始化方式 2.账号注册 3.插件安装 二、项目结构及重点文件介绍 1.项目基本结构 2.项目文件介绍 三、应用打包 1. 安卓打包 2.苹果打包 四、应用发布 1. 安卓市场发布 用户权限和隐私政策 注销 软著和App备案证书 2. 苹果市场发布 …...
为什么使用Golang而非Rust开发桌面应用?
MoonGuard 团队选择 Golang 而不是 Rust 作为他们的 Krater 桌面应用程序,因为 Golang 中更容易进行内存管理、类型安全和 ORM 支持。 使用 Rust 和 Tauri 时面临的一些挑战包括: 难以理解 Rust 的所有权和借用规则、其严格的类型安全有时会限制开发速…...
问题复盘|MySQL 数据记录中明明有值,使用 concat() 后得到的却一直是 null
背景 MySQL 的数据数据记录中明明有值,在使用 concat() 查询时却一直得到 null SELECT CONCAT(first_name, , last_name) FROM users;排查后发现 MySQL 的 concat 函数拼接规则是 当多个拼接的字段的字段值中存在 null 时,返回的一定是 null 解决方…...

正点原子嵌入式linux驱动开发——Linux IIO驱动
工业场合里面也有大量的模拟量和数字量之间的转换,也就是常说的ADC和DAC。而且随着手机、物联网、工业物联网和可穿戴设备的爆发,传感器的需求只持续增强。比如手机或者手环里面的加速度计、光传感器、陀螺仪、气压计、磁力计等,这些传感器本…...

利用角色roles上线wordpress项目
角色订制:roles ① 简介 对于以上所有的方式有个弊端就是无法实现复用假设在同时部署Web、db、ha 时或不同服务器组合不同的应用就需要写多个yml文件。很难实现灵活的调用。 roles 用于层次性、结构化地组织playbook。roles 能够根据层次型结构自动装载变量文…...

4.0 Linux进程前导知识
个人主页:Lei宝啊 愿所有美好如期而遇 冯.诺依曼体系 CPU:运算器,控制器 输入设备:键盘,麦克风,摄像头,鼠标,网卡,磁盘等。 输出设备:显示器࿰…...

推荐一份适合所有人做的副业,尤其是程序员。
我建议每个人都去尝试一下网上接单,这是一个门槛低、类型多样的方式,尤其适合程序员! 在接单平台上,你可以看到各种类型的兼职。以freelancer为例,你可以在这里找到技术、设计、写作等类型的兼职,只要发挥…...

Linux中字符设备的打开、写入
一个内核模块应该由以下几部分组成。 第一部分,头文件部分。一般的内核模块,都需要 include 下面两个头文件: #include <linux/module.h> #include <linux/init.h> 第二部分,定义一些函数,用于处理内核…...

3d max软件中的缓存垃圾该如何清理?
使用3d max建模到渲染操作,来回对效果图调整的次数过多时,就会出现一下看不到的垃圾缓存,影响保存的速度,影响效率! 对于这类的3d垃圾清理的有什么高效方法呢? 3dmax垃圾清理的常规操作如下: 1、…...

11.13 牛客刷题8/10
11.13 信号完整性 指针地址 的加减,注意 最后转为16进制...
CI/CD简介
CI/CD简介 1、CI/CD流水线2、什么是CI/CD3、CI/CD的优点4、CI/CD的工作原理5、CI/CD流水线工具6、CI/CD的应用7、CI/CD的未来趋势 1、CI/CD流水线 从最初的瀑布模型,到后来的敏捷开发,再到今天的DevOps,这是现代开发人员构建出色产品的技术路…...
python opencv 读取文件夹下所有MP4文件并解析成jpg图像
你可以使用Python的OpenCV库来读取文件夹中的所有MP4文件,并将其解析为JPG图像。以下是一个示例代码,演示了如何实现这个功能,并设置解析间隔为3帧: import os import cv2def extract_frames(input_folder, output_folder, inter…...

wordpress后台更新后 前端没变化的解决方法
使用siteground主机的wordpress网站,会出现更新了网站内容和修改了php模板文件、js文件、css文件、图片文件后,网站没有变化的情况。 不熟悉siteground主机的新手,遇到这个问题,就很抓狂,明明是哪都没操作错误&#x…...
【Java学习笔记】Arrays类
Arrays 类 1. 导入包:import java.util.Arrays 2. 常用方法一览表 方法描述Arrays.toString()返回数组的字符串形式Arrays.sort()排序(自然排序和定制排序)Arrays.binarySearch()通过二分搜索法进行查找(前提:数组是…...

23-Oracle 23 ai 区块链表(Blockchain Table)
小伙伴有没有在金融强合规的领域中遇见,必须要保持数据不可变,管理员都无法修改和留痕的要求。比如医疗的电子病历中,影像检查检验结果不可篡改行的,药品追溯过程中数据只可插入无法删除的特性需求;登录日志、修改日志…...
【磁盘】每天掌握一个Linux命令 - iostat
目录 【磁盘】每天掌握一个Linux命令 - iostat工具概述安装方式核心功能基础用法进阶操作实战案例面试题场景生产场景 注意事项 【磁盘】每天掌握一个Linux命令 - iostat 工具概述 iostat(I/O Statistics)是Linux系统下用于监视系统输入输出设备和CPU使…...
渲染学进阶内容——模型
最近在写模组的时候发现渲染器里面离不开模型的定义,在渲染的第二篇文章中简单的讲解了一下关于模型部分的内容,其实不管是方块还是方块实体,都离不开模型的内容 🧱 一、CubeListBuilder 功能解析 CubeListBuilder 是 Minecraft Java 版模型系统的核心构建器,用于动态创…...

DBAPI如何优雅的获取单条数据
API如何优雅的获取单条数据 案例一 对于查询类API,查询的是单条数据,比如根据主键ID查询用户信息,sql如下: select id, name, age from user where id #{id}API默认返回的数据格式是多条的,如下: {&qu…...

蓝桥杯3498 01串的熵
问题描述 对于一个长度为 23333333的 01 串, 如果其信息熵为 11625907.5798, 且 0 出现次数比 1 少, 那么这个 01 串中 0 出现了多少次? #include<iostream> #include<cmath> using namespace std;int n 23333333;int main() {//枚举 0 出现的次数//因…...

dify打造数据可视化图表
一、概述 在日常工作和学习中,我们经常需要和数据打交道。无论是分析报告、项目展示,还是简单的数据洞察,一个清晰直观的图表,往往能胜过千言万语。 一款能让数据可视化变得超级简单的 MCP Server,由蚂蚁集团 AntV 团队…...

人机融合智能 | “人智交互”跨学科新领域
本文系统地提出基于“以人为中心AI(HCAI)”理念的人-人工智能交互(人智交互)这一跨学科新领域及框架,定义人智交互领域的理念、基本理论和关键问题、方法、开发流程和参与团队等,阐述提出人智交互新领域的意义。然后,提出人智交互研究的三种新范式取向以及它们的意义。最后,总结…...

push [特殊字符] present
push 🆚 present 前言present和dismiss特点代码演示 push和pop特点代码演示 前言 在 iOS 开发中,push 和 present 是两种不同的视图控制器切换方式,它们有着显著的区别。 present和dismiss 特点 在当前控制器上方新建视图层级需要手动调用…...