如何从零训练多模态大模型(预训练方向)

news2024/10/7 8:23:09

节前,我们星球组织了一场算法岗技术&面试讨论会,邀请了一些互联网大厂朋友、参加社招和校招面试的同学.

针对算法岗技术趋势、大模型落地项目经验分享、新手如何入门算法岗、该如何准备、面试常考点分享等热门话题进行了深入的讨论。

汇总合集:

《大模型面试宝典》(2024版) 发布!


本文介绍如何训练 LLaVA v1.5 多模态模型。

LLaVA 训练包括特征对齐阶段(feature alignment stage)和视觉指令微调阶段(visual instruction tuning stage),其中特征对齐阶段使用 LAION-CC-SBU 数据集的 558K 子集(记为 LLaVA-Pretrain),目的是训练 MLP connector(或称为 projector),而视觉指令微调阶段使用 GPT-4 生成的 150K 条多模态指令跟随数据和来自学术任务的 515K 条 VQA 数据引导 LLaVA 模型遵从多模态指令。

官方给出的 LLaVA v1.5 使用了 8 个 A100 GPU(80G)进行训练,如果我们没有 8 个 GPU 或者足够的显存(80G),可以减小per_device_train_batch_size的值并增大gradient_accumulation_steps,始终保证全局 batch size 不变,其中 batch size 的大小等于 per_device_train_batch_sizexgradient_accumulation_stepsxnum_gpus 。

技术交流群

前沿技术资讯、算法交流、求职内推、算法竞赛、面试交流(校招、社招、实习)等、与 10000+来自港科大、北大、清华、中科院、CMU、腾讯、百度等名校名企开发者互动交流~

我们建了大模型算法岗技术与面试交流群, 想要进交流群、需要源码&资料、提升技术的同学,可以直接加微信号:mlc2060。加的时候备注一下:研究方向 +学校/公司+CSDN,即可。然后就可以拉你进群了。

方式①、微信搜索公众号:机器学习社区,后台回复:技术交流
方式②、添加微信号:mlc2040,备注:技术交流

用通俗易懂方式讲解系列

  • 用通俗易懂的方式讲解:自然语言处理初学者指南(附1000页的PPT讲解)
  • 用通俗易懂的方式讲解:1.6万字全面掌握 BERT
  • 用通俗易懂的方式讲解:NLP 这样学习才是正确路线
  • 用通俗易懂的方式讲解:28张图全解深度学习知识!
  • 用通俗易懂的方式讲解:不用再找了,这就是 NLP 方向最全面试题库
  • 用通俗易懂的方式讲解:实体关系抽取入门教程
  • 用通俗易懂的方式讲解:灵魂 20 问帮你彻底搞定Transformer
  • 用通俗易懂的方式讲解:图解 Transformer 架构
  • 用通俗易懂的方式讲解:大模型算法面经指南(附答案)
  • 用通俗易懂的方式讲解:十分钟部署清华 ChatGLM-6B,实测效果超预期
  • 用通俗易懂的方式讲解:内容讲解+代码案例,轻松掌握大模型应用框架 LangChain
  • 用通俗易懂的方式讲解:如何用大语言模型构建一个知识问答系统
  • 用通俗易懂的方式讲解:最全的大模型 RAG 技术概览
  • 用通俗易懂的方式讲解:利用 LangChain 和 Neo4j 向量索引,构建一个RAG应用程序
  • 用通俗易懂的方式讲解:使用 Neo4j 和 LangChain 集成非结构化知识图增强 QA
  • 用通俗易懂的方式讲解:面了 5 家知名企业的NLP算法岗(大模型方向),被考倒了。。。。。
  • 用通俗易懂的方式讲解:NLP 算法实习岗,对我后续找工作太重要了!。
  • 用通俗易懂的方式讲解:理想汽车大模型算法工程师面试,被问的瑟瑟发抖。。。。
  • 用通俗易懂的方式讲解:基于 Langchain-Chatchat,我搭建了一个本地知识库问答系统
  • 用通俗易懂的方式讲解:面试字节大模型算法岗(实习)
  • 用通俗易懂的方式讲解:大模型算法岗(含实习)最走心的总结
  • 用通俗易懂的方式讲解:大模型微调方法汇总

下面以 LLaVA-v1.5-13B 为例介绍 LLaVA 模型的训练。

特征对齐阶段

准备数据

下载 LLaVA-Pretrain[2] 数据集
# 将数据下载到 ./playground/data/LLaVA-Pretrain,否则需要修改启动脚本的 data_path 参数
huggingface-cli download --repo-type dataset liuhaotian/LLaVA-Pretrain --local-dir ./playground/data/LLaVA-Pretrain

LLaVA-Pretrain 包含 3 个文件:

  • blip_laion_cc_sbu_558k.json:此数据的构造过程是将 image-caption 数据添加随机选择的指令(例如:“Describe this image”)转换成多模态对话,下面是数据示例:
{
    'id': '004539375',
    'image': '00453/004539375.jpg',
    'conversations': [
      {
        'from': 'human',
        'value': 'Render a clear and concise summary of the photo.\n<image>'
      },
      {
        'from': 'gpt',
        'value': 'select luxury furniture 3 - inch gel memory foam mattress topper'
      }
    ]
  },
  • blip_laion_cc_sbu_558k_meta.json:包含 3 种元数据,分别是图像路径、图像 URL 和 blip_caption
{
    'id': '004539375',
    'image': '00453/004539375.jpg',
    'blip_caption': 'select luxury furniture 3 - inch gel memory foam mattress topper',
    'url': 'http://ec1.ostkcdn.com/images/products/8111140/P15459545.jpg'
  }
  • images.zip:LAION/CC/SBU 筛选后的子集
解压images.zip
# 解压到 ./playground/data/LLaVA-Pretrain/images,否则需要修改启动脚本的 image_folder 参数
unzip ./playground/data/LLaVA-Pretrain/images.zip -d ./playground/data/LLaVA-Pretrain/images

启动训练

在这个阶段,使用 8 个 A100(80G)训练 LLaVA-v1.5-13B 大约需要 5.5 小时。

启动的脚本是scripts/v1_5/pretrain.sh,它的内容如下:

#!/bin/bash
deepspeed llava/train/train_mem.py \
    --deepspeed ./scripts/zero2.json \  # 使用 DeepSpeed ZeRO-2
    --model_name_or_path lmsys/vicuna-13b-v1.5 \  # 语言模型是 lmsys/vicuna-13b-v1.5
    --version plain \
    --data_path ./playground/data/LLaVA-Pretrain/blip_laion_cc_sbu_558k.json \  # 训练样本文件
    --image_folder ./playground/data/LLaVA-Pretrain/images \  # 存放图像的目录
    --vision_tower openai/clip-vit-large-patch14-336 \  # 视觉编码器
    --mm_projector_type mlp2x_gelu \  # projector 的类型
    --tune_mm_mlp_adapter True \  # 是否训练 projector
    --mm_vision_select_layer -2 \
    --mm_use_im_start_end False \
    --mm_use_im_patch_token False \
    --bf16 True \
    --output_dir ./checkpoints/llava-v1.5-13b-pretrain \  # 保存的路径
    --num_train_epochs 1 \
    --per_device_train_batch_size 32 \
    --per_device_eval_batch_size 4 \
    --gradient_accumulation_steps 1 \
    --evaluation_strategy 'no' \
    --save_strategy 'steps' \
    --save_steps 24000 \
    --save_total_limit 1 \
    --learning_rate 1e-3 \
    --weight_decay 0. \
    --warmup_ratio 0.03 \
    --lr_scheduler_type 'cosine' \
    --logging_steps 1 \
    --tf32 True \
    --model_max_length 2048 \
    --gradient_checkpointing True \
    --dataloader_num_workers 4 \
    --lazy_preprocess True \
    --report_to wandb

启动脚本:

sh ./scripts/v1_5/pretrain.sh

启动训练后,会自动下载语言模型视觉编码器的权重,完成权重的下载后会提示是否需要使用 wandb 可视化结果,这里按需选择即可。

图片

接下来就开始了训练,下面是 loss 的部分日志:

图片

训练完成后,权重会保存在./checkpoints/llava-v1.5-13b-pretrain目录。

视觉指令微调阶段

完成特征对齐阶段的训练后,我们进入视觉指令微调阶段。注意:如果我们跳过特征对齐阶段的训练,则需要将对应的 projector 下载到./checkpoints目录,下载的命令如下:

huggingface-cli download liuhaotian/llava-v1.5-mlp2x-336px-pretrain-vicuna-13b-v1.5 --local-dir ./checkpoints/llava-v1.5-13b-pretrain

准备数据

下载数据集
  • 下载 llava_v1_5_mix665k.json[3]
# 将数据下载到 ./playground/data/LLaVA-Instruct-150K
huggingface-cli download --repo-type dataset liuhaotian/LLaVA-Instruct-150K --local-dir ./playground/data/LLaVA-Instruct-150K
cp ./playground/data/LLaVA-Instruct-150K/llava_v1_5_mix665k.json ./playground/data/llava_v1_5_mix665k.json

下面是 llava_v1_5_mix665k.json 的示例:

{
    'id': '000000033471',  // 样本的唯一 id
    'image': 'coco/train2017/000000033471.jpg',  // 可以是绝对路径,也可以是相对于 image_folder 的路径
    'conversations': [
      {
        'from': 'human',
        'value': '<image>\nWhat are the colors of the bus in the image?'
      },
      {
        'from': 'gpt',
        'value': 'The bus in the image is white and red.'
      },
      {
        'from': 'human',
        'value': 'What feature can be seen on the back of the bus?'
      },
      {
        'from': 'gpt',
        'value': 'The back of the bus features an advertisement.'
      },
      {
        'from': 'human',
        'value': 'Is the bus driving down the street or pulled off to the side?'
      },
      {
        'from': 'gpt',
        'value': 'The bus is driving down the street, which is crowded with people and other vehicles.'
      }
    ]
  },
  • 下载 COCO train2017[4]
wget http://images.cocodataset.org/zips/train2017.zip -P ./playground/data/coco
unzip ./playground/data/coco/train2017.zip -d ./playground/data/coco
  • 下载 GQA images[5]
wget https://downloads.cs.stanford.edu/nlp/data/gqa/images.zip -P ./playground/data/gqa
unzip ./playground/data/gqa/images.zip -d ./playground/data/gqa
  • •下载 OCR-VQA[6] 将 OCR-VQA 中的 dataset.json 和 loadDataset.py 文件下载到 ./playground/data/ocr_vqa 目录。注释 loadDataset.py 中的 pdb.set_trace()后执行下面的命令:
cd ./playground/data/ocr_vqa
python loadDataset.py
# 回到 LLaVA 目录
cd ../../../

使用下面的代码处理 OCR-VQA 图像的后缀问题[7]:

import json
import os

with open('./playground/data/llava_v1_5_mix665k.json') as f:
    samples = json.load(f)

for sample in samples:
    if 'image' not in sample:
        continue

    img_path = os.path.join('./playground/data', sample['image'])
    if not os.path.exists(img_path):
        # 处理 OCR-VQA 图像后缀和 llava_v1_5_mix665k.json 中的后缀不一致问题
        img_path_wo_ext = os.path.splitext(img_path)[0]
        for ext in ['.png', '.gif']:
            real_path = img_path_wo_ext + ext
            if os.path.exists(real_path):
                # 重命名
                os.replace(real_path, img_path)
                break

也可以参考 https://github.com/haotian-liu/LLaVA/pull/1458 给出的路径下载 ORC-VQA 数据。

  • 下载 TextVQA[8]
wget https://dl.fbaipublicfiles.com/textvqa/images/train_val_images.zip -P ./playground/data/textvqa
unzip ./playground/data/textvqa/train_val_images.zip -d ./playground/data/textvqa
  • 下载 VisualGenome part1[9] 和 part2[10]
wget https://cs.stanford.edu/people/rak248/VG_100K_2/images.zip -P ./playground/data/vg
wget https://cs.stanford.edu/people/rak248/VG_100K_2/images2.zip -P ./playground/data/vg
unzip ./playground/data/vg/images.zip -d ./playground/data/vg
unzip ./playground/data/vg/images2.zip -d ./playground/data/vg
数据集结构

完成数据集的下载后,检查数据集的目录结构是否和下面的一致:

├── coco
│   ├── train2017
│   │   ├── xxx.jpg
├── gqa
│   ├── images
│   │   ├── xxx.jpg
├── llava_v1_5_mix665k.json
├── ocr_vqa
│   ├── dataset.json
│   ├── images
│   │   ├── xxx.jpg
│   └── loadDataset.py
├── textvqa
│   ├── train_images
│   │   ├── xxx.jpg
│── vg
├── └── VG_100K
│   │   ├── xxx.jpg
├── │── VG_100K_2
│   │   ├── xxx.jpg

使用下面的代码检查数据目录结构:

import json
import os

with open('./playground/data/llava_v1_5_mix665k.json') as f:
    samples = json.load(f)

missing_cnt = 0  # 记录图像路径不存在的个数
for sample in samples:
    if 'image' not in sample:
        continue

    img_path = os.path.join('./playground/data', sample['image'])
    if not os.path.exists(img_path):
        missing_cnt += 1

print(missing_cnt)

如果 missing_cnt 为 0,则说明数据的目录结构是正确的。

启动训练

在启动训练前,请查看 https://github.com/haotian-liu/LLaVA/issues/1144 以避免训练结束后权重保存出错。

在这个阶段,使用 8 个 A100(80G)训练 LLaVA-v1.5-13B 大约需要 20 小时。启动的脚本是scripts/v1_5/finetune.sh,它的内容如下:

#!/bin/bash

deepspeed llava/train/train_mem.py \
    --deepspeed ./scripts/zero3.json \  # 使用 DeepSpeed ZeRO-3
    --model_name_or_path lmsys/vicuna-13b-v1.5 \
    --version v1 \
    --data_path ./playground/data/llava_v1_5_mix665k.json \  # 训练样本
    --image_folder ./playground/data \  # 存放图像的目录
    --vision_tower openai/clip-vit-large-patch14-336 \
    --pretrain_mm_mlp_adapter ./checkpoints/llava-v1.5-13b-pretrain/mm_projector.bin \
    --mm_projector_type mlp2x_gelu \  # projector 的类型
    --mm_vision_select_layer -2 \
    --mm_use_im_start_end False \
    --mm_use_im_patch_token False \
    --image_aspect_ratio pad \
    --group_by_modality_length True \
    --bf16 True \
    --output_dir ./checkpoints/llava-v1.5-13b \
    --num_train_epochs 1 \
    --per_device_train_batch_size 16 \
    --per_device_eval_batch_size 4 \
    --gradient_accumulation_steps 1 \
    --evaluation_strategy 'no' \
    --save_strategy 'steps' \
    --save_steps 50000 \
    --save_total_limit 1 \
    --learning_rate 2e-5 \
    --weight_decay 0. \
    --warmup_ratio 0.03 \
    --lr_scheduler_type 'cosine' \
    --logging_steps 1 \
    --tf32 True \
    --model_max_length 2048 \
    --gradient_checkpointing True \
    --dataloader_num_workers 4 \
    --lazy_preprocess True \
    --report_to wandb

启动脚本:

sh ./scripts/v1_5/finetune.sh

启动训练后,会询问是否需要使用 wandb 可视化结果,这里按需选择即可。

图片

接下来就开始了训练,下面是 loss 的部分日志:

图片

训练完成后,权重会保存在./checkpoints/llava-v1.5-13b目录。注意:如果单卡显存不足 80G,可以使用 LoRA 微调脚本 finetune_lora.sh[11]。完成训练后,可以参考 LLaVA 评测[12]对模型的性能进行评测。

微调自定义数据集

参考 Finetune LLaVA on Custom Datasets[13]

将训练样本以列表的形式保存到 json 文件,其中每一个样本是一个字典,它至少包含三个字段:

  • id:全局唯一的字符串

  • image:图片的路径,可以是绝对路径,也可以是相对于image_folder的相对路径

  • conversations:人类和语言模型的对话

下面是一个示例:

[
  {
    'id': '997bb945-628d-4724-b370-b84de974a19f',
    'image': 'part-000001/997bb945-628d-4724-b370-b84de974a19f.jpg',
    'conversations': [
      {
        'from': 'human',
        'value': '<image>\nWrite a prompt for Stable Diffusion to generate this image.'
      },
      {
        'from': 'gpt',
        'value': 'a beautiful painting of chernobyl by nekro, pascal blanche, john harris, greg rutkowski, sin jong hun, moebius, simon stalenhag. in style of cg art. ray tracing. cel shading. hyper detailed. realistic. ue 5. maya. octane render. '
      },
    ]
  },
  ...
]

完成数据的处理后,修改 finetune.sh[14] 中的 data_path 参数(必须)以及其他想要调整的参数(可选,例如学习率)。

修改完成后,即可启动训练:

sh ./scripts/v1_5/finetune.sh

以上就是 LLaVA 的训练流程。

引用链接

[1] 官方教程: https://github.com/haotian-liu/LLaVA?tab=readme-ov-file#train
[2] LLaVA-Pretrain: https://huggingface.co/datasets/liuhaotian/LLaVA-Pretrain
[3] llava_v1_5_mix665k.json: https://huggingface.co/datasets/liuhaotian/LLaVA-Instruct-150K/blob/main/llava_v1_5_mix665k.json
[4] COCO train2017: http://images.cocodataset.org/zips/train2017.zip
[5] GQA images: https://downloads.cs.stanford.edu/nlp/data/gqa/images.zip
[6] OCR-VQA: https://drive.google.com/drive/folders/1_GYPY5UkUy7HIcR0zq3ZCFgeZN7BAfm_?usp=sharing
[7] OCR-VQA 图像的后缀问题: https://github.com/haotian-liu/LLaVA/issues/601
[8] TextVQA: https://dl.fbaipublicfiles.com/textvqa/images/train_val_images.zip
[9] part1: https://cs.stanford.edu/people/rak248/VG_100K_2/images.zip
[10] part2: https://cs.stanford.edu/people/rak248/VG_100K_2/images2.zip
[11] finetune_lora.sh: https://github.com/haotian-liu/LLaVA/blob/main/scripts/v1_5/finetune_lora.sh
[12] LLaVA 评测: https://github.com/haotian-liu/LLaVA?tab=readme-ov-file#evaluation
[13] Finetune LLaVA on Custom Datasets: https://github.com/haotian-liu/LLaVA/blob/main/docs/Finetune_Custom_Data.md
[14] finetune.sh: https://github.com/haotian-liu/LLaVA/blob/main/scripts/v1_5/finetune.sh

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

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

相关文章

锌,能否成为下一个“铜”?

光大期货认为&#xff0c;今年以来&#xff0c;市场关注锌能否接棒铜价牛市。铜需求增长空间大&#xff0c;而锌消费结构传统&#xff0c;缺乏新亮点。虽然在供应的扰动上锌强于铜&#xff0c;但因需求乏善可陈&#xff0c;金融属性弱势&#xff0c;锌很难接棒铜&#xff0c;引…

Vue--》打造细腻颗粒感 —— 细分组件颗粒图

写文背景&#xff1a;当涉及到前端开发时&#xff0c;我们经常会发现自己在不同的组件中复用相似的逻辑&#xff0c;在过去我们可能会通过混入、高阶组件或者全局组件等方式来实现代码的复用&#xff1b;或者一个组件逻辑太多&#xff0c;写出了超多的响应式ref数据和五花八门的…

NHANES数据库及应用

NHANES数据库使用 NHANES - National Health and Nutrition Examination Survey Homepage (cdc.gov) 保姆级NHANES数据库使用教程 - 哔哩哔哩 (bilibili.com) 该数据库所涉及的参与者的死亡状况 &#xff1a;Data Access - National Death Index (cdc.gov) TyG对CVD的影响研…

Ubuntu基础-vim编辑器

目录 前言: 一. 安装 二. 配置 三. 基本使用 1.使用 Vim 编辑文本文件 2.代码编辑 3.多窗口编辑 四. 总结 前言: Vim 是从 VI 发展出来的一个文本编辑器&#xff0c;具有代码补充、错误跳转等功能&#xff0c;在程序员中被广泛使用。它的设计理念是命令的组合&#xff…

LeetCode | 27.移除元素

这道题的思路和26题一模一样&#xff0c;由于要在元素组中修改&#xff0c;我们可以设置一个index表示目前要修改原数组的第几位&#xff0c;由于遍历&#xff0c;访问原数组永远会在我们修改数组之前&#xff0c;所以不用担心数据丢失的问题&#xff0c;一次遍历数组&#xff…

分布式物联网平台特点

随着物联网&#xff08;IoT&#xff09;技术的飞速发展&#xff0c;我们正步入一个万物互联的新时代。在这个时代&#xff0c;设备、数据和服务的无缝集成是实现智能化的关键。分布式物联网平台作为这一进程的核心&#xff0c;正在成为构建智能世界的基石。 一、分布式物联网平…

AcWing 477:神经网络 ← 拓扑排序+链式前向星

【题目来源】https://www.acwing.com/problem/content/479/【题目描述】 人工神经网络&#xff08;Artificial Neural Network&#xff09;是一种新兴的具有自我学习能力的计算系统&#xff0c;在模式识别、函数逼近及贷款风险评估等诸多领域有广泛的应用。 对神经网络的研究…

ansible离线安装docker

docker简介&#xff1a; Docker 是一个开源的应用容器引擎&#xff0c;它允许开发者打包他们的应用以及应用的运行环境到一个可移植的容器中。这个容器可以在任何支持Docker的机器上运行&#xff0c;确保了应用在不同环境中的一致性。 网上有很多在线ansible安装docker的&…

决策树 #数据挖掘 #Python

拓展&#xff1a; sklearn简介&#xff1a; sklearn&#xff08;Scikit-learn&#xff09;是一个广泛使用的Python机器学习库&#xff0c;它是由Pedregosa等人在2011年创建的。这个库是基于NumPy和SciPy库构建的&#xff0c;提供了一系列简单易用的接口&#xff0c;用于数据预处…

从源码分析 vllm + Ray 的分布式推理流程

一、前言 随着 LLM 模型越来越大&#xff0c;单 GPU 已经无法加载一个模型。以 Qwen-14B-Chat 模型为例&#xff0c;模型权重大概 28GB&#xff0c;但是单个 NVIDIA A10 仅有 24GB 显存。如果想要在 A10 上部署 Qwen-14B-Chat 模型&#xff0c;我们需要将模型切分后部署到 2 个…

Vue2+Element-ui实现el-table表格自适应高度

效果图 新建指令 Vue.directive(height, {inserted(el, _binding, vnode) {const paginationRef vnode.context.$refs.paginationRefconst calculateHeight () > {const windowHeight window.innerHeightconst topOffset el.getBoundingClientRect().topconst otherEle…

怎么提高音频的播放速度?提高音频播放速度的四种方法

怎么提高音频的播放速度&#xff1f;提高音频的播放速度是在处理音频文件时经常需要面对的问题。音频播放速度的调整可以带来多种应用场景和效果&#xff0c;例如加快语音记录的回放速度以节省时间、提高听力理解和语速训练的效果等。然而&#xff0c;对于不同的音频播放工具和…

【Python】Python 2 测试网络连通性脚本

文章目录 前言1. 命令行传参2. 代码 前言 最近在只有python2的服务器上部署服务&#xff0c;不能用三方类库&#xff0c;这里出于好奇心学习下python。这里简单做个脚本&#xff0c;实现了检验网络连通性的功能&#xff08;类似于curl&#xff09;。 1. 命令行传参 使用命令…

LeetCode | 58.最后一个单词的长度

这道题要求最后一个单词的长度&#xff0c;第一个想到的就是反向遍历字符串&#xff0c;寻找最后一个单词并计算其长度。由于尾部可能会有’ &#xff0c;所以我们从后往前遍历字符串&#xff0c;找到第一个非空格的字符&#xff0c;然后记录下到下一个空格前依次有多少个字母即…

芯片后端对于芯片设计公司的重要性

在芯片设计流程中&#xff0c;后端设计是一个至关重要的环节&#xff0c;它直接关系到芯片从设计到实际生产的转化&#xff0c;以及最终产品的性能、可靠性、成本和上市时间。 以下是为什么芯片后端非常重要的几个关键原因&#xff1a; 物理实现&#xff1a;后端设计是芯片从逻…

20240612前端问题总结

20240612前端问题总结 给定固定大小的父 子盒子&#xff0c;要实现子盒子上下左右居中 使用calc()计算&#xff0c;子绝父相和子元素调整位置&#xff0c;flex弹性盒布局&#xff0c;transform&#xff0c;table-cell&#xff0c;浮动六种方法展示子元素垂直水平居中。 <…

人工智能系统中毒是一个日益严重的威胁

咨询公司 Protiviti 最近与一家客户公司合作&#xff0c;该公司遭遇了一次不寻常的攻击&#xff1a;一名黑客试图操纵输入该公司人工智能系统的数据。 公司领导仍在调查此次攻击&#xff0c;公司怀疑黑客试图扭曲人工智能系统的输出。 此类攻击并非新鲜事&#xff0c;但在网络…

stable diffusion中的negative prompt是如何工作的

https://stable-diffusion-art.com/how-negative-prompt-work/https://stable-diffusion-art.com/how-negative-prompt-work/https://zhuanlan.zhihu.com/p/644879268

技术速递|Microsoft Build 2024 中的 .NET 公告和更新

作者&#xff1a;.NET 团队 排版&#xff1a;Alan Wang 在 Microsoft Build 2024 上&#xff0c;我们很高兴推出一系列旨在使 .NET 开发更快、更容易的新功能和工具。 探索 Microsoft Build 2024 上的 .NET 会议&#xff0c;了解新功能的实际效果&#xff0c;或者通过下载 .NE…

【六】Linux安装部署Nginx web服务器--及编写服务器启动脚本

一、部署安装nginx 1、查看nginx是否安装依赖包 [rootlocalhost ~]# rpm -q zlib-devel pcre-devel package zlib-devel is not installed package pcre-devel is not installed 2、若没有则安装nginx 依赖包 [rootlocalhost ~]# yum -y install zlib-devel* pcre-dev…