cv_resnet101_face-detection_cvpr22papermogface保姆级教程:GPU显存占用监控与自动释放策略

news2026/4/1 17:37:21
cv_resnet101_face-detection_cvpr22papermogface保姆级教程GPU显存占用监控与自动释放策略1. 引言如果你正在使用基于ResNet101的MogFace人脸检测模型可能会遇到一个常见问题GPU显存占用越来越高最终导致程序崩溃。尤其是在处理批量图片或长时间运行服务时这个问题会更加明显。今天我将分享一套完整的GPU显存监控与自动释放策略。这不是简单的理论讲解而是可以直接复制使用的实战代码。通过本教程你将学会如何实时监控GPU显存使用情况如何设置智能的显存释放阈值如何实现自动清理而不中断服务如何优化Streamlit应用的显存管理无论你是刚接触深度学习部署的新手还是正在优化生产环境的工程师这套方案都能帮你解决显存泄漏的烦恼。2. 为什么需要显存管理2.1 显存泄漏的常见原因在使用MogFace这样的深度学习模型时显存泄漏通常由以下几个原因引起模型缓存未清理Streamlit的st.cache_resource虽然能加速推理但会长期占用显存中间变量累积每次推理产生的中间张量如果没有及时释放会逐渐累积图片预处理占用大尺寸图片的预处理会消耗大量显存多进程/多线程问题并发处理时显存释放可能不同步2.2 不管理显存的后果如果不进行显存管理你可能会遇到程序运行一段时间后突然崩溃无法处理批量图片任务系统响应越来越慢需要频繁重启服务3. 环境准备与基础监控3.1 安装必要的监控工具首先确保你的环境中安装了必要的监控库pip install pynvml psutilpynvml是NVIDIA官方的GPU监控库psutil用于监控系统内存。3.2 基础显存监控代码创建一个gpu_monitor.py文件添加以下基础监控功能import pynvml import psutil import time from datetime import datetime class GPUMonitor: def __init__(self): 初始化GPU监控器 pynvml.nvmlInit() self.device_count pynvml.nvmlDeviceGetCount() print(f检测到 {self.device_count} 个GPU设备) def get_gpu_info(self, device_id0): 获取指定GPU的详细信息 handle pynvml.nvmlDeviceGetHandleByIndex(device_id) # 获取显存信息 mem_info pynvml.nvmlDeviceGetMemoryInfo(handle) total_memory mem_info.total / 1024**3 # 转换为GB used_memory mem_info.used / 1024**3 free_memory mem_info.free / 1024**3 # 获取GPU利用率 utilization pynvml.nvmlDeviceGetUtilizationRates(handle) # 获取温度信息 temperature pynvml.nvmlDeviceGetTemperature(handle, pynvml.NVML_TEMPERATURE_GPU) return { device_id: device_id, total_memory_gb: round(total_memory, 2), used_memory_gb: round(used_memory, 2), free_memory_gb: round(free_memory, 2), memory_usage_percent: round((used_memory / total_memory) * 100, 1), gpu_utilization_percent: utilization.gpu, memory_utilization_percent: utilization.memory, temperature_c: temperature } def get_system_memory(self): 获取系统内存信息 mem psutil.virtual_memory() return { total_gb: round(mem.total / 1024**3, 2), used_gb: round(mem.used / 1024**3, 2), available_gb: round(mem.available / 1024**3, 2), usage_percent: mem.percent } def print_status(self, device_id0): 打印当前状态 gpu_info self.get_gpu_info(device_id) sys_mem self.get_system_memory() print(f\n[{datetime.now().strftime(%H:%M:%S)}] GPU状态:) print(f 显存使用: {gpu_info[used_memory_gb]}GB / {gpu_info[total_memory_gb]}GB ({gpu_info[memory_usage_percent]}%)) print(f GPU利用率: {gpu_info[gpu_utilization_percent]}%) print(f 温度: {gpu_info[temperature_c]}°C) print(f系统内存使用: {sys_mem[used_gb]}GB / {sys_mem[total_gb]}GB ({sys_mem[usage_percent]}%)) def cleanup(self): 清理资源 pynvml.nvmlShutdown() # 使用示例 if __name__ __main__: monitor GPUMonitor() try: while True: monitor.print_status() time.sleep(5) # 每5秒监控一次 except KeyboardInterrupt: print(\n监控停止) finally: monitor.cleanup()这段代码提供了基础的GPU监控功能可以实时查看显存使用情况、GPU利用率和温度。4. 集成到MogFace人脸检测应用4.1 修改Streamlit应用结构现在我们将监控功能集成到你的MogFace应用中。修改app.py文件import streamlit as st import cv2 import numpy as np from PIL import Image import json import time import torch import gc from gpu_monitor import GPUMonitor # 初始化GPU监控器 monitor GPUMonitor() # 设置页面配置 st.set_page_config( page_titleMogFace人脸检测 - 智能显存管理版, page_icon️, layoutwide ) # 侧边栏 - 显存监控面板 with st.sidebar: st.header( GPU显存监控) # 实时显示显存状态 if st.button(刷新显存状态): gpu_info monitor.get_gpu_info() # 显示进度条 mem_usage gpu_info[memory_usage_percent] st.progress(mem_usage / 100, textf显存使用率: {mem_usage}%) # 显示详细信息 col1, col2 st.columns(2) with col1: st.metric(已用显存, f{gpu_info[used_memory_gb]} GB) st.metric(GPU利用率, f{gpu_info[gpu_utilization_percent]}%) with col2: st.metric(可用显存, f{gpu_info[free_memory_gb]} GB) st.metric(温度, f{gpu_info[temperature_c]}°C) # 显存清理设置 st.header(⚙️ 显存管理设置) auto_clean st.checkbox(启用自动显存清理, valueTrue) if auto_clean: threshold st.slider( 清理阈值 (%), min_value50, max_value95, value85, help当显存使用率达到此阈值时自动清理 ) check_interval st.slider( 检查间隔 (秒), min_value5, max_value60, value10, help每隔多少秒检查一次显存使用率 ) st.divider() # 手动清理按钮 if st.button( 立即清理显存, typeprimary): with st.spinner(正在清理显存...): torch.cuda.empty_cache() gc.collect() st.success(显存清理完成) time.sleep(1) st.rerun() # 主应用区域保持不变 st.title(️ MogFace 极速智能人脸检测工具) st.write(基于CVPR 2022 MogFace模型的高性能人脸检测系统) # 原有的图片上传和检测代码... # [这里保持你原有的MogFace检测代码不变]4.2 添加自动清理线程为了在后台自动监控和清理显存我们需要添加一个后台线程。创建一个新的文件memory_manager.pyimport threading import time import torch import gc from gpu_monitor import GPUMonitor class AutoMemoryManager: def __init__(self, cleanup_threshold85, check_interval10): 自动显存管理器 参数: cleanup_threshold: 清理阈值显存使用率超过此值则触发清理 check_interval: 检查间隔秒 self.cleanup_threshold cleanup_threshold self.check_interval check_interval self.monitor GPUMonitor() self.running False self.thread None def start(self): 启动自动监控线程 if self.running: return self.running True self.thread threading.Thread(targetself._monitor_loop, daemonTrue) self.thread.start() print(f自动显存监控已启动阈值: {self.cleanup_threshold}%检查间隔: {self.check_interval}秒) def stop(self): 停止监控线程 self.running False if self.thread: self.thread.join(timeout2) self.monitor.cleanup() print(自动显存监控已停止) def _monitor_loop(self): 监控循环 while self.running: try: gpu_info self.monitor.get_gpu_info() mem_usage gpu_info[memory_usage_percent] # 如果显存使用率超过阈值触发清理 if mem_usage self.cleanup_threshold: print(f⚠️ 显存使用率过高 ({mem_usage}%)触发自动清理...) self._cleanup_memory() print(✅ 显存清理完成) time.sleep(self.check_interval) except Exception as e: print(f监控出错: {e}) time.sleep(self.check_interval) def _cleanup_memory(self): 执行显存清理 # 清理PyTorch缓存 if torch.cuda.is_available(): torch.cuda.empty_cache() # 清理Python垃圾 gc.collect() # 再次清理PyTorch缓存 if torch.cuda.is_available(): torch.cuda.empty_cache() def manual_cleanup(self): 手动清理显存 print(手动触发显存清理...) self._cleanup_memory() print(手动清理完成) def get_status(self): 获取当前状态 gpu_info self.monitor.get_gpu_info() return { running: self.running, threshold: self.cleanup_threshold, interval: self.check_interval, current_usage: gpu_info[memory_usage_percent], used_memory_gb: gpu_info[used_memory_gb], total_memory_gb: gpu_info[total_memory_gb] } # 单例模式确保只有一个管理器实例 _memory_manager None def get_memory_manager(cleanup_threshold85, check_interval10): 获取内存管理器实例 global _memory_manager if _memory_manager is None: _memory_manager AutoMemoryManager(cleanup_threshold, check_interval) return _memory_manager4.3 集成自动管理器到Streamlit应用修改app.py集成自动显存管理器# 在app.py开头添加 import streamlit as st from memory_manager import get_memory_manager # 初始化内存管理器 memory_manager get_memory_manager() # 在侧边栏设置中读取配置 with st.sidebar: # ... 原有的显存监控代码 ... st.header(⚙️ 显存管理设置) auto_clean st.checkbox(启用自动显存清理, valueTrue) if auto_clean: threshold st.slider( 清理阈值 (%), min_value50, max_value95, value85, help当显存使用率达到此阈值时自动清理 ) check_interval st.slider( 检查间隔 (秒), min_value5, max_value60, value10, help每隔多少秒检查一次显存使用率 ) # 更新管理器配置 memory_manager.cleanup_threshold threshold memory_manager.check_interval check_interval # 根据复选框状态启动/停止管理器 if auto_clean and not memory_manager.running: memory_manager.start() st.success(✅ 自动显存监控已启用) elif not auto_clean and memory_manager.running: memory_manager.stop() st.info(⏸️ 自动显存监控已暂停) # 显示当前状态 status memory_manager.get_status() st.caption(f当前显存使用率: {status[current_usage]}%) # 手动清理按钮 if st.button( 立即清理显存, typeprimary): with st.spinner(正在清理显存...): memory_manager.manual_cleanup() st.success(显存清理完成) time.sleep(1) st.rerun() # 在应用关闭时清理资源 import atexit atexit.register(memory_manager.stop)5. 高级显存优化策略5.1 动态批处理大小调整对于批量处理任务可以根据显存使用情况动态调整批处理大小class DynamicBatchProcessor: def __init__(self, initial_batch_size4, min_batch_size1, max_batch_size16): self.initial_batch_size initial_batch_size self.min_batch_size min_batch_size self.max_batch_size max_batch_size self.current_batch_size initial_batch_size self.monitor GPUMonitor() def process_images(self, images, model, preprocess_fn): 动态调整批处理大小处理图片 results [] i 0 while i len(images): # 获取当前显存状态 gpu_info self.monitor.get_gpu_info() mem_usage gpu_info[memory_usage_percent] # 根据显存使用率调整批处理大小 if mem_usage 90: self.current_batch_size max(self.min_batch_size, self.current_batch_size // 2) print(f⚠️ 显存紧张批处理大小调整为: {self.current_batch_size}) elif mem_usage 60 and self.current_batch_size self.max_batch_size: self.current_batch_size min(self.max_batch_size, self.current_batch_size * 2) print(f✅ 显存充足批处理大小调整为: {self.current_batch_size}) # 获取当前批次 batch images[i:i self.current_batch_size] # 预处理 batch_tensor torch.stack([preprocess_fn(img) for img in batch]) # 推理 with torch.no_grad(): batch_results model(batch_tensor) results.extend(batch_results) i len(batch) # 清理中间变量 del batch_tensor torch.cuda.empty_cache() return results5.2 图片预处理优化图片预处理也会占用大量显存这里提供优化方案class OptimizedImageProcessor: def __init__(self, target_size(640, 640), max_size1920): self.target_size target_size self.max_size max_size def optimize_image(self, image): 优化图片以减少显存占用 # 获取原始尺寸 height, width image.shape[:2] # 如果图片太大进行缩放 if max(height, width) self.max_size: scale self.max_size / max(height, width) new_width int(width * scale) new_height int(height * scale) image cv2.resize(image, (new_width, new_height)) print(f图片从 {width}x{height} 缩放至 {new_width}x{new_height}) # 转换为模型需要的格式 # 这里根据你的模型需求进行调整 processed cv2.cvtColor(image, cv2.COLOR_BGR2RGB) processed processed.astype(np.float32) / 255.0 return processed def batch_optimize(self, images, max_batch_memory_mb500): 批量优化图片控制显存占用 optimized_images [] for img in images: # 估算当前批次显存占用 estimated_memory len(optimized_images) * img.nbytes / (1024**2) # 如果超过限制先处理当前批次 if estimated_memory max_batch_memory_mb: yield optimized_images optimized_images [] torch.cuda.empty_cache() optimized self.optimize_image(img) optimized_images.append(optimized) if optimized_images: yield optimized_images5.3 模型推理优化优化模型推理过程减少显存占用class MemoryEfficientInference: def __init__(self, model, devicecuda): self.model model.to(device) self.device device self.model.eval() # 设置为评估模式 torch.no_grad() def inference_with_gc(self, input_tensor, cleanup_every_n10): 带垃圾回收的推理 参数: input_tensor: 输入张量 cleanup_every_n: 每N次推理清理一次显存 # 确保输入在正确的设备上 if isinstance(input_tensor, list): # 批量处理 results [] for i, tensor in enumerate(input_tensor): tensor tensor.to(self.device).unsqueeze(0) output self.model(tensor) results.append(output.cpu()) # 立即转移到CPU # 清理中间变量 del tensor if (i 1) % cleanup_every_n 0: torch.cuda.empty_cache() return results else: # 单张处理 input_tensor input_tensor.to(self.device) output self.model(input_tensor) result output.cpu() # 清理 del input_tensor torch.cuda.empty_cache() return result def stream_inference(self, image_generator, batch_size4): 流式推理适用于大量图片 batch [] results [] for i, image in enumerate(image_generator): batch.append(image) if len(batch) batch_size: # 处理当前批次 batch_tensor torch.stack(batch).to(self.device) batch_output self.model(batch_tensor) results.extend(batch_output.cpu()) # 清理 del batch_tensor, batch_output batch [] torch.cuda.empty_cache() print(f已处理 {i1} 张图片) # 处理剩余图片 if batch: batch_tensor torch.stack(batch).to(self.device) batch_output self.model(batch_tensor) results.extend(batch_output.cpu()) del batch_tensor, batch_output torch.cuda.empty_cache() return results6. 完整集成示例下面是一个完整的MogFace应用示例集成了所有显存优化策略import streamlit as st import cv2 import numpy as np from PIL import Image import torch import json import time # 导入我们的优化模块 from gpu_monitor import GPUMonitor from memory_manager import get_memory_manager from optimized_inference import MemoryEfficientInference # 初始化 monitor GPUMonitor() memory_manager get_memory_manager(cleanup_threshold85, check_interval10) # 设置页面 st.set_page_config( page_titleMogFace人脸检测 - 智能显存管理, layoutwide ) # 侧边栏 - 显存管理面板 with st.sidebar: st.title( 显存智能管理) # 实时状态显示 gpu_info monitor.get_gpu_info() # 显存使用进度条 mem_usage gpu_info[memory_usage_percent] st.progress(mem_usage / 100, textf显存使用: {gpu_info[used_memory_gb]}GB / {gpu_info[total_memory_gb]}GB ({mem_usage}%)) # 指标卡片 col1, col2 st.columns(2) with col1: st.metric(GPU利用率, f{gpu_info[gpu_utilization_percent]}%) st.metric(可用显存, f{gpu_info[free_memory_gb]}GB) with col2: st.metric(温度, f{gpu_info[temperature_c]}°C) st.metric(系统内存, f{gpu_info[memory_utilization_percent]}%) st.divider() # 自动清理设置 st.subheader(⚙️ 自动清理设置) auto_enabled st.toggle(启用自动清理, valueTrue) if auto_enabled: threshold st.slider(清理阈值 (%), 50, 95, 85) interval st.slider(检查间隔 (秒), 5, 60, 10) # 更新配置 memory_manager.cleanup_threshold threshold memory_manager.check_interval interval if not memory_manager.running: memory_manager.start() st.success(✅ 自动监控已启用) else: if memory_manager.running: memory_manager.stop() st.info(⏸️ 自动监控已暂停) st.divider() # 手动控制 st.subheader(️ 手动控制) col1, col2 st.columns(2) with col1: if st.button( 刷新状态, use_container_widthTrue): st.rerun() with col2: if st.button( 清理显存, typeprimary, use_container_widthTrue): with st.spinner(清理中...): memory_manager.manual_cleanup() st.success(清理完成!) time.sleep(1) st.rerun() # 历史记录 st.divider() st.subheader( 历史记录) # 这里可以添加显存使用历史图表 # 实际项目中可以使用时间序列数据库记录 # 主应用区域 st.title(️ MogFace 人脸检测系统) st.caption(集成智能显存管理的高性能人脸检测工具) # 原有的MogFace检测界面代码 # [这里保持你原有的界面代码] # 在检测函数中添加显存监控 def detect_faces_with_monitoring(image, model): 带显存监控的人脸检测 # 记录开始时的显存 start_mem monitor.get_gpu_info()[used_memory_gb] # 执行检测 with st.spinner(检测中...): results model(image) # 记录结束时的显存 end_mem monitor.get_gpu_info()[used_memory_gb] mem_increase end_mem - start_mem # 显示显存变化 st.info(f本次检测显存占用: {mem_increase:.2f}GB) # 如果显存增加过多建议清理 if mem_increase 1.0: # 如果增加超过1GB st.warning(检测占用显存较多建议清理显存) return results # 应用退出时的清理 import atexit def cleanup_on_exit(): 应用退出时的清理函数 print(应用退出清理资源...) memory_manager.stop() monitor.cleanup() torch.cuda.empty_cache() atexit.register(cleanup_on_exit) # 添加一个定时任务定期显示显存状态 if last_check not in st.session_state: st.session_state.last_check time.time() current_time time.time() if current_time - st.session_state.last_check 30: # 每30秒更新一次 status memory_manager.get_status() st.sidebar.caption(f 上次检查: {time.strftime(%H:%M:%S)}) st.sidebar.caption(f 当前使用率: {status[current_usage]}%) st.session_state.last_check current_time7. 总结通过本教程我们为MogFace人脸检测应用实现了一套完整的GPU显存监控与自动释放策略。这套方案的主要优势包括7.1 核心功能回顾实时监控可以实时查看GPU显存使用率、温度、利用率等关键指标自动清理当显存使用超过设定阈值时自动触发清理手动控制提供一键清理按钮随时释放显存动态调整根据显存状态动态调整批处理大小优化推理减少中间变量占用及时清理缓存7.2 实际效果在实际使用中这套方案可以防止程序崩溃通过自动清理避免显存耗尽提升稳定性长时间运行不再需要手动重启优化资源利用智能调整批处理大小最大化GPU利用率方便监控通过Streamlit界面直观查看显存状态7.3 使用建议阈值设置建议将清理阈值设置在80-90%之间留出一定缓冲空间检查间隔根据应用负载调整检查间隔一般10-30秒为宜批量处理对于批量任务使用动态批处理大小调整定期监控定期查看显存使用历史了解应用的内存模式7.4 扩展思路这套方案还可以进一步扩展历史数据分析记录显存使用历史分析内存泄漏模式预警系统当显存使用持续高位时发送警报自动缩放根据显存使用情况自动调整服务规模多GPU支持扩展支持多GPU环境的监控和管理通过这套智能的显存管理策略你的MogFace人脸检测应用将更加稳定可靠能够处理更复杂的任务和更长时间的运行。无论是开发测试还是生产部署都能提供更好的使用体验。获取更多AI镜像想探索更多AI镜像和应用场景访问 CSDN星图镜像广场提供丰富的预置镜像覆盖大模型推理、图像生成、视频生成、模型微调等多个领域支持一键部署。

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

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

相关文章

SpringBoot-17-MyBatis动态SQL标签之常用标签

文章目录 1 代码1.1 实体User.java1.2 接口UserMapper.java1.3 映射UserMapper.xml1.3.1 标签if1.3.2 标签if和where1.3.3 标签choose和when和otherwise1.4 UserController.java2 常用动态SQL标签2.1 标签set2.1.1 UserMapper.java2.1.2 UserMapper.xml2.1.3 UserController.ja…

wordpress后台更新后 前端没变化的解决方法

使用siteground主机的wordpress网站,会出现更新了网站内容和修改了php模板文件、js文件、css文件、图片文件后,网站没有变化的情况。 不熟悉siteground主机的新手,遇到这个问题,就很抓狂,明明是哪都没操作错误&#x…

网络编程(Modbus进阶)

思维导图 Modbus RTU(先学一点理论) 概念 Modbus RTU 是工业自动化领域 最广泛应用的串行通信协议,由 Modicon 公司(现施耐德电气)于 1979 年推出。它以 高效率、强健性、易实现的特点成为工业控制系统的通信标准。 包…

UE5 学习系列(二)用户操作界面及介绍

这篇博客是 UE5 学习系列博客的第二篇,在第一篇的基础上展开这篇内容。博客参考的 B 站视频资料和第一篇的链接如下: 【Note】:如果你已经完成安装等操作,可以只执行第一篇博客中 2. 新建一个空白游戏项目 章节操作,重…

IDEA运行Tomcat出现乱码问题解决汇总

最近正值期末周,有很多同学在写期末Java web作业时,运行tomcat出现乱码问题,经过多次解决与研究,我做了如下整理: 原因: IDEA本身编码与tomcat的编码与Windows编码不同导致,Windows 系统控制台…

利用最小二乘法找圆心和半径

#include <iostream> #include <vector> #include <cmath> #include <Eigen/Dense> // 需安装Eigen库用于矩阵运算 // 定义点结构 struct Point { double x, y; Point(double x_, double y_) : x(x_), y(y_) {} }; // 最小二乘法求圆心和半径 …

使用docker在3台服务器上搭建基于redis 6.x的一主两从三台均是哨兵模式

一、环境及版本说明 如果服务器已经安装了docker,则忽略此步骤,如果没有安装,则可以按照一下方式安装: 1. 在线安装(有互联网环境): 请看我这篇文章 传送阵>> 点我查看 2. 离线安装(内网环境):请看我这篇文章 传送阵>> 点我查看 说明&#xff1a;假设每台服务器已…

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器的上位机配置操作说明

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器专为工业环境精心打造&#xff0c;完美适配AGV和无人叉车。同时&#xff0c;集成以太网与语音合成技术&#xff0c;为各类高级系统&#xff08;如MES、调度系统、库位管理、立库等&#xff09;提供高效便捷的语音交互体验。 L…

(LeetCode 每日一题) 3442. 奇偶频次间的最大差值 I (哈希、字符串)

题目&#xff1a;3442. 奇偶频次间的最大差值 I 思路 &#xff1a;哈希&#xff0c;时间复杂度0(n)。 用哈希表来记录每个字符串中字符的分布情况&#xff0c;哈希表这里用数组即可实现。 C版本&#xff1a; class Solution { public:int maxDifference(string s) {int a[26]…

【大模型RAG】拍照搜题技术架构速览:三层管道、两级检索、兜底大模型

摘要 拍照搜题系统采用“三层管道&#xff08;多模态 OCR → 语义检索 → 答案渲染&#xff09;、两级检索&#xff08;倒排 BM25 向量 HNSW&#xff09;并以大语言模型兜底”的整体框架&#xff1a; 多模态 OCR 层 将题目图片经过超分、去噪、倾斜校正后&#xff0c;分别用…

【Axure高保真原型】引导弹窗

今天和大家中分享引导弹窗的原型模板&#xff0c;载入页面后&#xff0c;会显示引导弹窗&#xff0c;适用于引导用户使用页面&#xff0c;点击完成后&#xff0c;会显示下一个引导弹窗&#xff0c;直至最后一个引导弹窗完成后进入首页。具体效果可以点击下方视频观看或打开下方…

接口测试中缓存处理策略

在接口测试中&#xff0c;缓存处理策略是一个关键环节&#xff0c;直接影响测试结果的准确性和可靠性。合理的缓存处理策略能够确保测试环境的一致性&#xff0c;避免因缓存数据导致的测试偏差。以下是接口测试中常见的缓存处理策略及其详细说明&#xff1a; 一、缓存处理的核…

龙虎榜——20250610

上证指数放量收阴线&#xff0c;个股多数下跌&#xff0c;盘中受消息影响大幅波动。 深证指数放量收阴线形成顶分型&#xff0c;指数短线有调整的需求&#xff0c;大概需要一两天。 2025年6月10日龙虎榜行业方向分析 1. 金融科技 代表标的&#xff1a;御银股份、雄帝科技 驱动…

观成科技:隐蔽隧道工具Ligolo-ng加密流量分析

1.工具介绍 Ligolo-ng是一款由go编写的高效隧道工具&#xff0c;该工具基于TUN接口实现其功能&#xff0c;利用反向TCP/TLS连接建立一条隐蔽的通信信道&#xff0c;支持使用Let’s Encrypt自动生成证书。Ligolo-ng的通信隐蔽性体现在其支持多种连接方式&#xff0c;适应复杂网…

铭豹扩展坞 USB转网口 突然无法识别解决方法

当 USB 转网口扩展坞在一台笔记本上无法识别,但在其他电脑上正常工作时,问题通常出在笔记本自身或其与扩展坞的兼容性上。以下是系统化的定位思路和排查步骤,帮助你快速找到故障原因: 背景: 一个M-pard(铭豹)扩展坞的网卡突然无法识别了,扩展出来的三个USB接口正常。…

未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?

编辑&#xff1a;陈萍萍的公主一点人工一点智能 未来机器人的大脑&#xff1a;如何用神经网络模拟器实现更智能的决策&#xff1f;RWM通过双自回归机制有效解决了复合误差、部分可观测性和随机动力学等关键挑战&#xff0c;在不依赖领域特定归纳偏见的条件下实现了卓越的预测准…

Linux应用开发之网络套接字编程(实例篇)

服务端与客户端单连接 服务端代码 #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <arpa/inet.h> #include <pthread.h> …

华为云AI开发平台ModelArts

华为云ModelArts&#xff1a;重塑AI开发流程的“智能引擎”与“创新加速器”&#xff01; 在人工智能浪潮席卷全球的2025年&#xff0c;企业拥抱AI的意愿空前高涨&#xff0c;但技术门槛高、流程复杂、资源投入巨大的现实&#xff0c;却让许多创新构想止步于实验室。数据科学家…

深度学习在微纳光子学中的应用

深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向&#xff1a; 逆向设计 通过神经网络快速预测微纳结构的光学响应&#xff0c;替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…