YOLOv8目标检测部署RK3588全过程,附代码pt->onnx->rknn,附【详细代码】

目录

一、训练yolov8模型,得到最佳权重文件best.pt

二、pt转onnx,即best.pt->best11.onnx

1、对下载的YOLOv8代码修改

2、加入模型导出功能,

3、导出指令采用如下代码

三、ONNX转RKNN

四、RK3588部署

1、拷贝rknn文件到rk3588板子内

2、执行代码段rknnlite_inference.py


一、训练yolov8模型,得到最佳权重文件best.pt

训练过程省略。。。。

二、pt转onnx,即best.pt->best11.onnx

1、对下载的YOLOv8代码修改,

位置:ultralytics_yolov8_main/ultralytics/nn/modules/head.py

在Detect类添加如下代码段:

y = []
for i in range(self.nl):y.append(self.cv2[i](x[i])) cls = torch.sigmoid(self.cv3[i](x[i]))cls_sum = torch.clamp(cls.sum(1, keepdim=True), 0, 1)y.append(cls)y.append(cls_sum)
return y

如下图所示: 

2、加入模型导出功能,

对model.py中的 _load函数添加如下代码段,位置:ultralytics_yolov8-main\ultralytics\engine\model.py

print("===========  onnx =========== ")import torchself.model.fuse()self.model.eval()self.model.load_state_dict(torch.load('./model/best11.pt', map_location='cpu'), strict=False)dummy_input = torch.randn(1, 3, 640, 640)input_names = ["data"]output_names = ["reg1", "cls1", "reg2", "cls2", "reg3", "cls3"]torch.onnx.export(self.model, dummy_input, "./best111.onnx", verbose=False, input_names=input_names,output_names=output_names, opset_version=12)print("======================== convert onnx Finished! .... ")
3、导出指令采用如下代码:
from ultralytics import YOLOmodel = YOLO('./model/best11.pt')
results = model(task='detect', mode='predict', source='C:/Users\lzy06\Desktop\zxq/relaticdata',line_thickness=3, show=False, save=True, device='cpu')

确认导出成功,即可忽略所报错误 。

使用网页链接https://netron.app打开onnx文件,查看输出是否一致,如下所示:

三、ONNX转RKNN

配置该环境需要在linux系统下,先安装rknn_toolkit2,安装过程可网上查阅。。。

验证安装完毕:终端输入python 后再输入from rknn.api import RKNN,是否报错。 

 转换代码onnx2rknn.py如下:

import os
import urllib
import traceback
import time
import sys
import numpy as np
import cv2
from rknn.api import RKNN
from math import expONNX_MODEL = './best111.onnx'
RKNN_MODEL = './best111.rknn'
DATASET = './dataset.txt'QUANTIZE = FalseCLASSES = ['broke', 'good', 'lose']meshgrid = []class_num = len(CLASSES)
headNum = 3
strides = [8, 16, 32]
mapSize = [[80, 80], [40, 40], [20, 20]]
nmsThresh = 0.5
objectThresh = 0.5input_imgH = 640
input_imgW = 640class DetectBox:def __init__(self, classId, score, xmin, ymin, xmax, ymax):self.classId = classIdself.score = scoreself.xmin = xminself.ymin = yminself.xmax = xmaxself.ymax = ymaxdef GenerateMeshgrid():for index in range(headNum):for i in range(mapSize[index][0]):for j in range(mapSize[index][1]):meshgrid.append(j + 0.5)meshgrid.append(i + 0.5)def IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2):xmin = max(xmin1, xmin2)ymin = max(ymin1, ymin2)xmax = min(xmax1, xmax2)ymax = min(ymax1, ymax2)innerWidth = xmax - xmininnerHeight = ymax - ymininnerWidth = innerWidth if innerWidth > 0 else 0innerHeight = innerHeight if innerHeight > 0 else 0innerArea = innerWidth * innerHeightarea1 = (xmax1 - xmin1) * (ymax1 - ymin1)area2 = (xmax2 - xmin2) * (ymax2 - ymin2)total = area1 + area2 - innerAreareturn innerArea / totaldef NMS(detectResult):predBoxs = []sort_detectboxs = sorted(detectResult, key=lambda x: x.score, reverse=True)for i in range(len(sort_detectboxs)):xmin1 = sort_detectboxs[i].xminymin1 = sort_detectboxs[i].yminxmax1 = sort_detectboxs[i].xmaxymax1 = sort_detectboxs[i].ymaxclassId = sort_detectboxs[i].classIdif sort_detectboxs[i].classId != -1:predBoxs.append(sort_detectboxs[i])for j in range(i + 1, len(sort_detectboxs), 1):if classId == sort_detectboxs[j].classId:xmin2 = sort_detectboxs[j].xminymin2 = sort_detectboxs[j].yminxmax2 = sort_detectboxs[j].xmaxymax2 = sort_detectboxs[j].ymaxiou = IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)if iou > nmsThresh:sort_detectboxs[j].classId = -1return predBoxsdef sigmoid(x):return 1 / (1 + exp(-x))def postprocess(out, img_h, img_w):print('postprocess ... ')detectResult = []output = []for i in range(len(out)):print(out[i].shape)output.append(out[i].reshape((-1)))scale_h = img_h / input_imgHscale_w = img_w / input_imgWgridIndex = -2cls_index = 0cls_max = 0for index in range(headNum):reg = output[index * 2 + 0]cls = output[index * 2 + 1]for h in range(mapSize[index][0]):for w in range(mapSize[index][1]):gridIndex += 2if 1 == class_num:cls_max = sigmoid(cls[0 * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w])cls_index = 0else:for cl in range(class_num):cls_val = cls[cl * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w]if 0 == cl:cls_max = cls_valcls_index = clelse:if cls_val > cls_max:cls_max = cls_valcls_index = clcls_max = sigmoid(cls_max)if cls_max > objectThresh:regdfl = []for lc in range(4):sfsum = 0locval = 0for df in range(16):temp = exp(reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w])reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w] = tempsfsum += tempfor df in range(16):sfval = reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w] / sfsumlocval += sfval * dfregdfl.append(locval)x1 = (meshgrid[gridIndex + 0] - regdfl[0]) * strides[index]y1 = (meshgrid[gridIndex + 1] - regdfl[1]) * strides[index]x2 = (meshgrid[gridIndex + 0] + regdfl[2]) * strides[index]y2 = (meshgrid[gridIndex + 1] + regdfl[3]) * strides[index]xmin = x1 * scale_wymin = y1 * scale_hxmax = x2 * scale_wymax = y2 * scale_hxmin = xmin if xmin > 0 else 0ymin = ymin if ymin > 0 else 0xmax = xmax if xmax < img_w else img_wymax = ymax if ymax < img_h else img_hbox = DetectBox(cls_index, cls_max, xmin, ymin, xmax, ymax)detectResult.append(box)# NMSprint('detectResult:', len(detectResult))predBox = NMS(detectResult)return predBoxdef export_rknn_inference(img):# Create RKNN objectrknn = RKNN(verbose=False)# pre-process configprint('--> Config model')rknn.config(mean_values=[[0, 0, 0]], std_values=[[255, 255, 255]], quantized_algorithm='normal', quantized_method='channel', target_platform='rk3588')print('done')# Load ONNX modelprint('--> Loading model')ret = rknn.load_onnx(model=ONNX_MODEL)if ret != 0:print('Load model failed!')exit(ret)print('done')# Build modelprint('--> Building model')ret = rknn.build(do_quantization=QUANTIZE, dataset=DATASET, rknn_batch_size=1)if ret != 0:print('Build model failed!')exit(ret)print('done')# Export RKNN modelprint('--> Export rknn model')ret = rknn.export_rknn(RKNN_MODEL)if ret != 0:print('Export rknn model failed!')exit(ret)print('done')# Init runtime environmentprint('--> Init runtime environment')ret = rknn.init_runtime()# ret = rknn.init_runtime(target='rk3566')if ret != 0:print('Init runtime environment failed!')exit(ret)print('done')# Inferenceprint('--> Running model')outputs = rknn.inference(inputs=[img])rknn.release()print('done')return outputsif __name__ == '__main__':print('This is main ...')GenerateMeshgrid()img_path = './dataset/00003.png'orig_img = cv2.imread(img_path)img_h, img_w = orig_img.shape[:2]origimg = cv2.resize(orig_img, (input_imgW, input_imgH), interpolation=cv2.INTER_LINEAR)origimg = cv2.cvtColor(origimg, cv2.COLOR_BGR2RGB)img = np.expand_dims(origimg, 0)outputs = export_rknn_inference(img)out = []for i in range(len(outputs)):out.append(outputs[i])predbox = postprocess(out, img_h, img_w)print(len(predbox))for i in range(len(predbox)):xmin = int(predbox[i].xmin)ymin = int(predbox[i].ymin)xmax = int(predbox[i].xmax)ymax = int(predbox[i].ymax)classId = predbox[i].classIdscore = predbox[i].scorecv2.rectangle(orig_img, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)ptext = (xmin, ymin)title = CLASSES[classId] + ":%.2f" % (score)cv2.putText(orig_img, title, ptext, cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2, cv2.LINE_AA)cv2.imwrite('./test_rknn_result.jpg', orig_img)# cv2.imshow("test", origimg)# cv2.waitKey(0)

四、RK3588部署

1、拷贝rknn文件到rk3588板子内。
2、执行代码段rknnlite_inference.py

(其实和onnx2rknn.py代码一样,唯独区别于板子上是使用RKNNLite)我这里修改了代码,补充了视频和图像文件的测试代码段,如下所示:

import glob
import os
import urllib
import traceback
import time
import sys
import numpy as np
import cv2
from rknnlite.api import RKNNLite
from math import expRKNN_MODEL = './model/detect_FQ.rknn'dataset_file = './dataset.txt'
img_folder = "./dataset"
video_path = "00001.mp4"
video_inference = Falseresult_path = './detect_result'
CLASSES = ['broke', 'good', 'lose']meshgrid = []class_num = len(CLASSES)
headNum = 3
strides = [8, 16, 32]
mapSize = [[80, 80], [40, 40], [20, 20]]
nmsThresh = 0.5
objectThresh = 0.5input_imgH = 640
input_imgW = 640class DetectBox:def __init__(self, classId, score, xmin, ymin, xmax, ymax):self.classId = classIdself.score = scoreself.xmin = xminself.ymin = yminself.xmax = xmaxself.ymax = ymaxdef GenerateMeshgrid():for index in range(headNum):for i in range(mapSize[index][0]):for j in range(mapSize[index][1]):meshgrid.append(j + 0.5)meshgrid.append(i + 0.5)def IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2):xmin = max(xmin1, xmin2)ymin = max(ymin1, ymin2)xmax = min(xmax1, xmax2)ymax = min(ymax1, ymax2)innerWidth = xmax - xmininnerHeight = ymax - ymininnerWidth = innerWidth if innerWidth > 0 else 0innerHeight = innerHeight if innerHeight > 0 else 0innerArea = innerWidth * innerHeightarea1 = (xmax1 - xmin1) * (ymax1 - ymin1)area2 = (xmax2 - xmin2) * (ymax2 - ymin2)total = area1 + area2 - innerAreareturn innerArea / totaldef NMS(detectResult):predBoxs = []sort_detectboxs = sorted(detectResult, key=lambda x: x.score, reverse=True)for i in range(len(sort_detectboxs)):xmin1 = sort_detectboxs[i].xminymin1 = sort_detectboxs[i].yminxmax1 = sort_detectboxs[i].xmaxymax1 = sort_detectboxs[i].ymaxclassId = sort_detectboxs[i].classIdif sort_detectboxs[i].classId != -1:predBoxs.append(sort_detectboxs[i])for j in range(i + 1, len(sort_detectboxs), 1):if classId == sort_detectboxs[j].classId:xmin2 = sort_detectboxs[j].xminymin2 = sort_detectboxs[j].yminxmax2 = sort_detectboxs[j].xmaxymax2 = sort_detectboxs[j].ymaxiou = IOU(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)if iou > nmsThresh:sort_detectboxs[j].classId = -1return predBoxsdef sigmoid(x):return 1 / (1 + exp(-x))def postprocess(out, img_h, img_w):print('postprocess ... ')detectResult = []output = []for i in range(len(out)):print(out[i].shape)output.append(out[i].reshape((-1)))scale_h = img_h / input_imgHscale_w = img_w / input_imgWgridIndex = -2cls_index = 0cls_max = 0for index in range(headNum):reg = output[index * 2 + 0]cls = output[index * 2 + 1]for h in range(mapSize[index][0]):for w in range(mapSize[index][1]):gridIndex += 2if 1 == class_num:cls_max = sigmoid(cls[0 * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w])cls_index = 0else:for cl in range(class_num):cls_val = cls[cl * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w]if 0 == cl:cls_max = cls_valcls_index = clelse:if cls_val > cls_max:cls_max = cls_valcls_index = clcls_max = sigmoid(cls_max)if cls_max > objectThresh:regdfl = []for lc in range(4):sfsum = 0locval = 0for df in range(16):temp = exp(reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h *mapSize[index][1] + w])reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w] = tempsfsum += tempfor df in range(16):sfval = reg[((lc * 16) + df) * mapSize[index][0] * mapSize[index][1] + h * mapSize[index][1] + w] / sfsumlocval += sfval * dfregdfl.append(locval)x1 = (meshgrid[gridIndex + 0] - regdfl[0]) * strides[index]y1 = (meshgrid[gridIndex + 1] - regdfl[1]) * strides[index]x2 = (meshgrid[gridIndex + 0] + regdfl[2]) * strides[index]y2 = (meshgrid[gridIndex + 1] + regdfl[3]) * strides[index]xmin = x1 * scale_wymin = y1 * scale_hxmax = x2 * scale_wymax = y2 * scale_hxmin = xmin if xmin > 0 else 0ymin = ymin if ymin > 0 else 0xmax = xmax if xmax < img_w else img_wymax = ymax if ymax < img_h else img_hbox = DetectBox(cls_index, cls_max, xmin, ymin, xmax, ymax)detectResult.append(box)# NMSprint('detectResult:', len(detectResult))predBox = NMS(detectResult)return predBoxdef export_rknnlite_inference(img):# Create RKNN objectrknnlite = RKNNLite(verbose=False)# Load ONNX modelprint('--> Loading model')ret = rknnlite.load_rknn(RKNN_MODEL)if ret != 0:print('Load model failed!')exit(ret)print('done')# Init runtime environmentprint('--> Init runtime environment')# ret = rknnlite.init_runtime()ret = rknnlite.init_runtime(core_mask=RKNNLite.NPU_CORE_0_1_2)if ret != 0:print('Init runtime environment failed!')exit(ret)print('done')# Inferenceprint('--> Running model')outputs = rknnlite.inference(inputs=[img])rknnlite.release()print('done')return outputsdef get_dataset_txt(dataset_path, dataset_savefile):file_data = glob.glob(os.path.join(dataset_path, "*.png"))with open(dataset_savefile, "r") as f:for file in file_data:f.readlines(f"{file}\n")if __name__ == '__main__':print('This is main ...')GenerateMeshgrid()isExist = os.path.exists(result_path)if not isExist:os.makedirs(result_path)if video_inference == False:print('--> image -----------------------------------------')img_names = os.listdir(img_folder)initime = time.time()num = 0for name in img_names:img_path = os.path.join(img_folder, name)num += 1start = time.time()orig_img = cv2.imread(img_path)img_h, img_w = orig_img.shape[:2]origimg = cv2.resize(orig_img, (input_imgW, input_imgH), interpolation=cv2.INTER_LINEAR)origimg = cv2.cvtColor(origimg, cv2.COLOR_BGR2RGB)img = np.expand_dims(origimg, 0)outputs = export_rknnlite_inference(img)out = []for i in range(len(outputs)):out.append(outputs[i])predbox = postprocess(out, img_h, img_w)print('detect:', len(predbox))fps = 1 / (time.time() - start)print('fps: ', fps, num / (time.time() - initime))for i in range(len(predbox)):xmin = int(predbox[i].xmin)ymin = int(predbox[i].ymin)xmax = int(predbox[i].xmax)ymax = int(predbox[i].ymax)classId = predbox[i].classIdscore = predbox[i].scorecv2.rectangle(orig_img, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)ptext = (xmin, ymin)title = CLASSES[classId] + ":%.2f" % (score)cv2.putText(orig_img, title, ptext, cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2, cv2.LINE_AA)cv2.imwrite(f'./{result_path}/{name}', orig_img)cv2.imshow("test", orig_img)cv2.waitKey(1)end = time.time()print('avgTimes:', num / (end - initime), num, end - initime)else:print('--> video -----------------------------------------')cap = cv2.VideoCapture(video_path)initime = time.time()num = 0v = cv2.VideoWriter(f'./{result_path}/detect.avi', cv2.VideoWriter_fourcc(*'MJPG'), 30, (1920, 1080))while (cap.isOpened()):num += 1ret, frame = cap.read()print('ret:', ret)if not ret:breakstart = time.time()img_h, img_w = frame.shape[:2]frame = cv2.resize(frame, (input_imgW, input_imgH), interpolation=cv2.INTER_LINEAR)frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)img = np.expand_dims(frame, 0)outputs = export_rknnlite_inference(img)out = []for i in range(len(outputs)):out.append(outputs[i])predbox = postprocess(out, img_h, img_w)print('detect:', len(predbox))fps = 1 / (time.time() - start)print('fps: ', fps, num / (time.time() - initime))for i in range(len(predbox)):xmin = int(predbox[i].xmin)ymin = int(predbox[i].ymin)xmax = int(predbox[i].xmax)ymax = int(predbox[i].ymax)classId = predbox[i].classIdscore = predbox[i].scoreprint(f'point  score :', CLASSES[classId], score)cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)ptext = (xmin, ymin)title = CLASSES[classId] + ":%.2f" % (score)cv2.putText(frame, title, ptext, cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2, cv2.LINE_AA)cv2.imshow("output", frame)# i = cv2.resize(frame, (640, 640))v.write(frame)cv2.imwrite(f'./{result_path}/test_rknn_result.jpg', frame)cv2.waitKey(1)end = time.time()print('avgTimes:', num / (end - initime), num, end-initime)

大功告成,创作不易,辛苦点个赞????

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

48.x86游戏实战-封包抓取进图call

免责声明&#xff1a;内容仅供学习参考&#xff0c;请合法利用知识&#xff0c;禁止进行违法犯罪活动&#xff01; 本次游戏没法给 内容参考于&#xff1a;微尘网络安全 工具下载&#xff1a; 链接&#xff1a;https://pan.baidu.com/s/1rEEJnt85npn7N38Ai0_F2Q?pwd6tw3 提…

使用Supervisor守护Nginx进程

supervisor是个好工具。superviosr是一个Linux/Unix系统上的进程监控工具&#xff0c;Supervisor是用Python开发的一套通用的进程管理程序&#xff0c;能将一个普通的命令行进程变为后台daemon&#xff0c;并监控进程状态&#xff0c;异常退出时能自动重启。只要在supervisor的…

递归神经网络 (RNN) 简介

文章目录 一、介绍二、什么是递归神经网络 &#xff08;RNN&#xff09;&#xff1f;三、展开递归神经网络四、训练递归神经网络五、RNN 的类型六、现实生活中的 RNN 用例七、RNN 的两个主要限制八、RNN的变体8.1 双向递归神经网络 &#xff08;BRNN&#xff09;8.2 长短期记忆…

YOLOv8改进 | 融合改进 | C2f融合Faster-GELU模块提升检测速度【完整代码 + 主要代码解析】

秋招面试专栏推荐 &#xff1a;深度学习算法工程师面试问题总结【百面算法工程师】——点击即可跳转 &#x1f4a1;&#x1f4a1;&#x1f4a1;本专栏所有程序均经过测试&#xff0c;可成功执行&#x1f4a1;&#x1f4a1;&#x1f4a1; 专栏目录 &#xff1a;《YOLOv8改进有效…

240824字节笔试题复盘

测试/测试开发方向 1、用户文档测试场景 2、大根堆排列顺序 3、时间复杂度对比 4、资源分配 5、矩阵排列 6、TCP和UDP区别 7、栈 8、用例分析与选择 9、信息脱敏 10、数据库并发 11、锁 12、边界值等价类用例设计 13、信息安全与防御 14、有关复选框的测试用例 …

节省 60% 成本还能加速业务扩展,ScraperAPI 在云基础设施上的多年实践

对于流量密集型的业务来讲&#xff0c;在创业初期&#xff0c;最头疼的就是数据库的管理&#xff0c;以及大量流量带来的高额账单。然而&#xff0c;ScraperAPI 通过结合使用 DigitalOcean 的 Droplet、托管数据库、应用托管服务和 Kubernetes&#xff0c;一箭三雕&#xff0c;…

基于信号量和环形队列的生产者消费者模型

文章目录 POSIX信号量信号量接口初始化信号量销毁信号量等待信号量发布信号量 基于环形队列的生产者消费者模型单生产单消费多生产多消费 POSIX信号量 POSIX信号量和SystemV信号量作用相同&#xff0c;都是用于同步操作&#xff0c;达到无冲突的访问共享资源目的。 但POSIX可以…

接口返回结果封装

接口返回结果封装 1、错误信息枚举 package com.zhw.enums;public enum AppHttpCodeEnum {// 成功SUCCESS(200,"操作成功"),// 登录NEED_LOGIN(401,"需要登录后操作"),NO_OPERATOR_AUTH(403,"无权限操作"),SYSTEM_ERROR(500,"出现错误&quo…

K-medoids算法原理及Python实践

一、原理 K-medoids算法是一种聚类算法&#xff0c;它的原理与K-Means算法相似&#xff0c;但关键区别在于它使用数据集中的实际点&#xff08;称为medoids&#xff09;作为簇的中心点&#xff0c;而不是像K-Means那样使用簇内所有点的平均值。以下是K-medoids算法的主要原理&…

Excel 保持原序时计算组内排名

Excel某表格第1列是分组&#xff0c;第2列是日期&#xff0c;未排序。 AB1Agent IDDate of Sale2Agent107-12-20233Agent105-12-20234Agent209-12-20235Agent313-12-20236Agent214-12-20237Agent222-12-20238Agent115-12-20239Agent117-12-202310Agent213-12-202311Agent120-1…

wooyu漏洞库YYDS!!!入门之道:重现乌云漏洞库

目录 wooyun乌云漏洞库搭建 1、搭建资料 文件结构分析&#xff1a; ​编辑2、搭建过程 2.1、搭建wooyun网站 2.2、配置数据库 2.2.1、修改数据库配置文件conn.php 2.2.2、创建wooyun数据库&#xff0c;并解压数据库文件 2.2.3、连接数据库&#xff08;数据库默认连接密…

24.8.26学习心得

验证数据集&#xff08;Validation Set&#xff09;和测试数据集&#xff08;Test Set&#xff09;在机器学习和深度学习中都是非常重要的概念。它们各自有不同的用途和目的。下面详细解释两者之间的区别&#xff1a; 1. 验证数据集&#xff08;Validation Set&#xff09; 目…

计算机基础知识总结(八股文--计算机网络、操作系统、数据库、c++、数据结构与算法)

一、操作系统 0.内存管理 01.什么是虚拟内存&#xff1f;为什么需要虚拟内存&#xff1f; 虚拟内存为程序提供比实际物理内存更大的内存空间&#xff0c;同时提高内存管理的灵活性和系统的多任务处理能力。虚拟地址空间就是进程所能看到的内存空间&#xff0c;这段空间是连续…

【案例61】update driver error

问题现象 顾问在保存数据源时报“update driver error”错误&#xff0c;重启服务器&#xff0c;重启sysConfig.bat后问题依旧。 问题分析 之前碰到这类问题发现是权限的问题。所以先去检查了相关文件夹的权限。 查看控制台发现客户用的是非Administrator用户登录&#xff0…

数学建模2024国赛时间及事项安排

2024年的全国大学生数学建模竞赛即将拉开帷幕。考虑到许多同学可能是首次参与此类赛事&#xff0c;尚不清楚如何进行有效的时间安排&#xff0c;博主在此整理了以往参赛的经验和时间管理策略&#xff0c;希望能为大家提供一些有益的参考&#xff0c;更从容地应对国赛。 本届全国…

网络安全 DVWA通关指南 DVWA File Upload(文件上传)

DVWA File Upload&#xff08;文件上传&#xff09; 文章目录 DVWA File Upload&#xff08;文件上传&#xff09;修复建议 LowMediumHighImpossible 修复建议 1、使用白名单限制可以上传的文件扩展名 2、注意0x00截断攻击&#xff08;PHP更新到最新版本&#xff09; 3、对上传…

Ubuntu 20.04 源码编译安装OpenCV 4.5.0

源码安装 OpenCV 4.5 官方文档&#xff1a; OpenCV: Install OpenCV-Python in Ubuntu 1. 安装编译依赖 sudo apt install build-essential cmake git pkg-config libgtk-3-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ libxvidcore-dev libx264-dev …

出口MID电能表到欧洲市场

出口MID电能表到欧洲市场&#xff01; 浙江永泰隆电子有限公司在研发和将MID能量计出口到欧盟市场方面具有丰富的经验。以下是突显该公司专业性的概述&#xff1a; 公司概况&#xff1a; 浙江永泰隆电子有限公司是一家专注于先进能量测量解决方案的制造商&#xff0c;特别是…

【栈】| 力扣高频题: 有效的括号

&#x1f397;️ 主页&#xff1a;小夜时雨 &#x1f397;️专栏&#xff1a;算法题 &#x1f397;️如何活着&#xff0c;是我找寻的方向 目录 1. 题目解析2. 代码 1. 题目解析 题目链接: 力扣20&#xff1a;https://leetcode.cn/problems/valid-parentheses/description/ 本…

linux系统中USB模块基本原理分析

大家好,今天主要给大家分享一下,USB设备的发展历程。 第一:USB发展变化 随着时代的发展,USB模块也随之不断的升级。 USB1.1:规范了USB低全速传输; USB2.0:规范了USB高速传输,采用NRZI(反向不归零)编码(NRZI采用8bit编码方式),位填充(在数据进行NRZI编码前…