昇思MindSpore学习笔记2-03 LLM原理和实践--基于MindSpore通过GPT实现情感分类

摘要:

昇思MindSpore AI框架中使用openai-gpt的方法、步骤。

没调通,存疑。

一、环境配置

%%capture captured_output
# 实验环境已经预装了mindspore==2.2.14,如需更换mindspore版本,可更改下面mindspore的版本号
!pip uninstall mindspore -y
!pip install -i https://pypi.mirrors.ustc.edu.cn/simple mindspore==2.2.14
# 该案例在 mindnlp 0.3.1 版本完成适配,如果发现案例跑不通,可以指定mindnlp版本,执行`!pip install mindnlp==0.3.1`
!pip install mindnlp==0.3.1
!pip install jieba
%env HF_ENDPOINT=https://hf-mirror.com

输出:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: mindnlp==0.3.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (0.3.1)
Requirement already satisfied: mindspore in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (2.2.14)
Requirement already satisfied: tqdm in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (4.66.4)
Requirement already satisfied: requests in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (2.32.3)
Requirement already satisfied: datasets in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (2.20.0)
Requirement already satisfied: evaluate in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.4.2)
Requirement already satisfied: tokenizers in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.19.1)
Requirement already satisfied: safetensors in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.4.3)
Requirement already satisfied: sentencepiece in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.2.0)
Requirement already satisfied: regex in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (2024.5.15)
Requirement already satisfied: addict in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (2.4.0)
Requirement already satisfied: ml-dtypes in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.4.0)
Requirement already satisfied: pyctcdecode in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.5.0)
Requirement already satisfied: jieba in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (0.42.1)
Requirement already satisfied: pytest==7.2.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindnlp==0.3.1) (7.2.0)
Requirement already satisfied: attrs>=19.2.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.3.1) (23.2.0)
Requirement already satisfied: iniconfig in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.3.1) (2.0.0)
Requirement already satisfied: packaging in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.3.1) (23.2)
Requirement already satisfied: pluggy<2.0,>=0.12 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.3.1) (1.5.0)
Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.3.1) (1.2.0)
Requirement already satisfied: tomli>=1.0.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pytest==7.2.0->mindnlp==0.3.1) (2.0.1)
Requirement already satisfied: filelock in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (3.15.3)
Requirement already satisfied: numpy>=1.17 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (1.26.4)
Requirement already satisfied: pyarrow>=15.0.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (16.1.0)
Requirement already satisfied: pyarrow-hotfix in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (0.6)
Requirement already satisfied: dill<0.3.9,>=0.3.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (0.3.8)
Requirement already satisfied: pandas in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (2.2.2)
Requirement already satisfied: xxhash in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (3.4.1)
Requirement already satisfied: multiprocess in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (0.70.16)
Requirement already satisfied: fsspec<=2024.5.0,>=2023.1.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from fsspec[http]<=2024.5.0,>=2023.1.0->datasets->mindnlp==0.3.1) (2024.5.0)
Requirement already satisfied: aiohttp in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (3.9.5)
Requirement already satisfied: huggingface-hub>=0.21.2 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (0.23.4)
Requirement already satisfied: pyyaml>=5.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from datasets->mindnlp==0.3.1) (6.0.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from requests->mindnlp==0.3.1) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from requests->mindnlp==0.3.1) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from requests->mindnlp==0.3.1) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from requests->mindnlp==0.3.1) (2024.6.2)
Requirement already satisfied: protobuf>=3.13.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore->mindnlp==0.3.1) (5.27.1)
Requirement already satisfied: asttokens>=2.0.4 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore->mindnlp==0.3.1) (2.0.5)
Requirement already satisfied: pillow>=6.2.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore->mindnlp==0.3.1) (10.3.0)
Requirement already satisfied: scipy>=1.5.4 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore->mindnlp==0.3.1) (1.13.1)
Requirement already satisfied: psutil>=5.6.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore->mindnlp==0.3.1) (5.9.0)
Requirement already satisfied: astunparse>=1.6.3 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from mindspore->mindnlp==0.3.1) (1.6.3)
Requirement already satisfied: pygtrie<3.0,>=2.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pyctcdecode->mindnlp==0.3.1) (2.5.0)
Requirement already satisfied: hypothesis<7,>=6.14 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pyctcdecode->mindnlp==0.3.1) (6.104.2)
Requirement already satisfied: six in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from asttokens>=2.0.4->mindspore->mindnlp==0.3.1) (1.16.0)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from astunparse>=1.6.3->mindspore->mindnlp==0.3.1) (0.43.0)
Requirement already satisfied: aiosignal>=1.1.2 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.3.1) (1.3.1)
Requirement already satisfied: frozenlist>=1.1.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.3.1) (1.4.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.3.1) (6.0.5)
Requirement already satisfied: yarl<2.0,>=1.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.3.1) (1.9.4)
Requirement already satisfied: async-timeout<5.0,>=4.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from aiohttp->datasets->mindnlp==0.3.1) (4.0.3)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from huggingface-hub>=0.21.2->datasets->mindnlp==0.3.1) (4.11.0)
Requirement already satisfied: sortedcontainers<3.0.0,>=2.1.0 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from hypothesis<7,>=6.14->pyctcdecode->mindnlp==0.3.1) (2.4.0)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pandas->datasets->mindnlp==0.3.1) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pandas->datasets->mindnlp==0.3.1) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (from pandas->datasets->mindnlp==0.3.1) (2024.1)[notice] A new release of pip is available: 24.1 -> 24.1.1
[notice] To update, run: python -m pip install --upgrade pip
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: jieba in /home/nginx/miniconda/envs/jupyter/lib/python3.9/site-packages (0.42.1)[notice] A new release of pip is available: 24.1 -> 24.1.1
[notice] To update, run: python -m pip install --upgrade pip
env: HF_ENDPOINT=https://hf-mirror.com

导入os mindspore dataset nn _legacy等模块

import os
​
import mindspore
from mindspore.dataset import text, GeneratorDataset, transforms
from mindspore import nn
​
from mindnlp.dataset import load_dataset
​
from mindnlp._legacy.engine import Trainer, Evaluator
from mindnlp._legacy.engine.callbacks import CheckpointCallback, BestModelCallback
from mindnlp._legacy.metrics import Accuracy

输出:

Building prefix dict from the default dictionary ...
Dumping model to file cache /tmp/jieba.cache
Loading model cost 1.027 seconds.
Prefix dict has been built successfully.

二、加载训练数据集和测试数据集

imdb_ds = load_dataset('imdb', split=['train', 'test'])
imdb_train = imdb_ds['train']
imdb_test = imdb_ds['test']

输出:

Downloading readme:-- 7.81k/? [00:00<00:00, 478kB/s]
Downloading data: 100%---------------- 21.0M/21.0M [00:09<00:00, 2.43MB/s]
Downloading data: 100%---------------- 20.5M/20.5M [00:10<00:00, 1.95MB/s]
Downloading data: 100%---------------- 42.0M/42.0M [00:16<00:00, 2.69MB/s]
Generating train split: 100%---------------- 25000/25000 [00:00<00:00, 102317.15 examples/s]
Generating test split: 100%---------------- 25000/25000 [00:00<00:00, 130128.57 examples/s]
Generating unsupervised split: 100%---------------- 50000/50000 [00:00<00:00, 140883.29 examples/s]

imdb_train.get_dataset_size()

输出:

25000

三、预处理数据集

import numpy as np
​
def process_dataset(dataset, tokenizer, max_seq_len=512, batch_size=4, shuffle=False):is_ascend = mindspore.get_context('device_target') == 'Ascend'def tokenize(text):if is_ascend:tokenized = tokenizer(text, padding='max_length', truncation=True, max_length=max_seq_len)else:tokenized = tokenizer(text, truncation=True, max_length=max_seq_len)return tokenized['input_ids'], tokenized['attention_mask']
​if shuffle:dataset = dataset.shuffle(batch_size)
​# map dataset
dataset = dataset.map(operations=[tokenize], input_columns="text", 
output_columns=['input_ids', 'attention_mask'])
dataset = dataset.map(operations=transforms.TypeCast(mindspore.int32), 
input_columns="label", output_columns="labels")# batch datasetif is_ascend:dataset = dataset.batch(batch_size)else:dataset = dataset.padded_batch(batch_size, pad_info={'input_ids': (None, tokenizer.pad_token_id),'attention_mask': (None, 0)})
​return dataset

from mindnlp.transformers import GPTTokenizer
# tokenizer
gpt_tokenizer = GPTTokenizer.from_pretrained('openai-gpt')
​
# add sepcial token: <PAD>
special_tokens_dict = {"bos_token": "<bos>","eos_token": "<eos>","pad_token": "<pad>",
}
num_added_toks = gpt_tokenizer.add_special_tokens(special_tokens_dict)

输出:

连接失败,不知是否openai关闭服务的原因。

【从此往下,执行不下去了】

100%---------------- 25.0/25.0 [00:00<00:00, 2.39kB/s]---------------- 533k/0.00 [00:35<00:00, 49.3kB/s]
Failed to download: HTTPSConnectionPool(host='hf-mirror.com', port=443): Read timed out.
Retrying... (attempt 0/5)---------------- 263k/0.00 [00:08<00:00, 57.6kB/s]---------------- 378k/0.00 [00:41<00:00, 5.35kB/s]
Failed to download: HTTPSConnectionPool(host='hf-mirror.com', port=443): Read timed out.
Retrying... (attempt 0/5)---------------- 69.6k/0.00 [00:01<00:00, 35.7kB/s]---------------- 684k/0.00 [00:45<00:00, 8.49kB/s]
Failed to download: HTTPSConnectionPool(host='hf-mirror.com', port=443): Read timed out.
Retrying... (attempt 0/5)---------------- 559k/0.00 [00:36<00:00, 27.3kB/s]---------------- 656/? [00:00<00:00, 62.5kB/s]

# split train dataset into train and valid datasets
imdb_train, imdb_val = imdb_train.split([0.7, 0.3])
dataset_train = process_dataset(imdb_train, gpt_tokenizer, shuffle=True)
dataset_val   = process_dataset(imdb_val, gpt_tokenizer)
dataset_test  = process_dataset(imdb_test, gpt_tokenizer)

next(dataset_train.create_tuple_iterator())

输出:

[Tensor(shape=[4, 512], dtype=Int64, value=[[   11,   250,    15 ...     3,   242,     3],[    5,    23,     5 ... 40480, 40480, 40480],[   14,     3,     5 ...   243,     8, 18073],[    7,   250,     3 ... 40480, 40480, 40480]]),Tensor(shape=[4, 512], dtype=Int64, value=[[1, 1, 1 ... 1, 1, 1],[1, 1, 1 ... 0, 0, 0],[1, 1, 1 ... 1, 1, 1],[1, 1, 1 ... 0, 0, 0]]),Tensor(shape=[4], dtype=Int32, value= [0, 1, 0, 1])]

from mindnlp.transformers import GPTForSequenceClassification
from mindspore.experimental.optim import Adam# set bert config and define parameters for training
model = GPTForSequenceClassification.from_pretrained('openai-gpt', num_labels=2)
model.config.pad_token_id = gpt_tokenizer.pad_token_id
model.resize_token_embeddings(model.config.vocab_size + 3)optimizer = nn.Adam(model.trainable_params(), learning_rate=2e-5)metric = Accuracy()# define callbacks to save checkpoints
ckpoint_cb = CheckpointCallback(save_path='checkpoint', ckpt_name='gpt_imdb_finetune', epochs=1, keep_checkpoint_max=2)
best_model_cb = BestModelCallback(save_path='checkpoint', ckpt_name='gpt_imdb_finetune_best', auto_load=True)trainer = Trainer(network=model, train_dataset=dataset_train,eval_dataset=dataset_train, metrics=metric,epochs=1, optimizer=optimizer, callbacks=[ckpoint_cb, best_model_cb],jit=False)

输出:

100%----------------  457M/457M [04:06<00:00, 2.87MB/s]
100%----------------  74.0/74.0 [00:00<00:00, 4.28kB/s]

四、训练

trainer.run(tgt_columns="labels")

五、评估

evaluator = Evaluator(network=model, eval_dataset=dataset_test, metrics=metric)
evaluator.run(tgt_columns="labels")

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

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

相关文章

Autogen智能体实战-Autogen框架介绍

文章目录 一&#xff0c;Autogen简介二&#xff0c;Autogen原理1&#xff0c;Autogen原理图解2&#xff0c;拆解Autogen是如何完成绘制特斯拉股票趋势图的 这篇文章介绍一个开源的Agent框架-微软的Autogen。 一&#xff0c;Autogen简介 官网:https://microsoft.github.io/aut…

前端页面操作防抖函数封装及应用

1、使用背景 函数防抖其实是作为一名前端同学必备的技能了&#xff0c;之前一直偷懒都借用页面loading或者按钮loading来实现。最近在开发微信小程序&#xff0c;过多的loading会带来不好的体验&#xff0c;同时在跳转页面的时候&#xff0c;不好用loading来防抖。所以就会出现…

【Unity】RPG2D龙城纷争(九)战斗系统之角色移动

更新日期:2024年7月8日。 项目源码:第五章发布(正式开始游戏逻辑的章节) 索引 简介一、角色战斗状态二、角色移动1.角色起飞(移动前)2.角色降落(移动后)3.生成移动路径4.角色移动三、整合简介 之前的章节做了这么多准备工作,现在终于要进入我们最为核心的战斗系统的编…

在idea中查看某个接口的所有实现类图

一、选中某个接口右键 ---> Diagrams ---> show Diagrams&#xff0c;然后就会进入一个新的 tab 页&#xff1b; 二、然后在出来的图上选中某个接口右键 ---> show Implementations&#xff0c;就会显示选中接口的所有实现类列表&#xff1b; 三、最后 ctrl A 全部选…

Defender Cloud Apps部署方案

目录 Defender Cloud Apps是什么? Defender Cloud Apps&#xff1a;保护您的云应用程序免受威胁 1. 全面的云应用发现与评估 2. 实时的用户活动监控 3. 深度的数据保护 4. 合规性管理与报告 5. 统一的安全管理 Defender Cloud Apps主要功能 1. 可见性和洞察 2. 数据保…

uniapp父页面调用子页面 组件方法记录

文章目录 导文如何点击父页面&#xff0c;触发子页面函数先写一个子页面的基础内容父元素 如何点击父页面&#xff0c;修改子页面的值先写一个子页面的基础内容父元素 导文 如何点击父页面&#xff0c;触发子页面函数&#xff1f; 如何点击父页面&#xff0c;修改子页面的值&am…

英区PayPal账号3分钟绑定WISE英镑的银行收款账户

正文开始&#xff0c;我们先登录英区PayPal账号后 有很多银行给我们选择&#xff0c;但是没有WISE的选项&#xff0c;所以我们手动输入“WISE”&#xff0c;然后如下图所示点击“Enter Your Bank Detailds”输入银行详细信息按钮。 然后输入我们的WISE英镑账户的收款银行信息&a…

Advanced Electronic Materials:磁性智能皮肤作为人机界面

近年来&#xff0c;电子可穿戴设备的普及率迅速上升&#xff0c;柔性可穿戴设备因其高生物相容性、功能性、适应性和低成本而在人机界面上引起了极大的关注。柔性磁性智能皮肤是这一快速发展的柔性可穿戴电子领域的一部分&#xff0c;为人类感知发展开辟了一条新的道路。磁感是…

SpringCloud第一篇Docker基础

文章目录 一、常见命令二、数据卷三、数据挂载四、自定义镜像五、网络 一、常见命令 Docker最常见的命令就是操作镜像、容器的命令&#xff0c;详见官方文档&#xff1a; https://docs.docker.com/ 需求&#xff1a; 在DockerHub中搜索Nginx镜像&#xff0c;查看镜像的名称 …

k8s集群如kubeadm init和kube-flannel.yam问题

查看k8s中角色内容kubectl get all (显示pod和server以及delment) 删除应用资源选择删除先删除部署查看部署和pod没了服务还在&#xff0c;但资源和功能以及删除&#xff0c;删除服务kubectl delete 服务名&#xff08;部署名&#xff09;&#xff0c;get pods 获取默认空间的容…

A133 Android10 root修改

1.前言 客户应用需求root相关的权限&#xff0c;我们需要修改系统的权限才可以满足客户需求 2.修改方法 frameworks层&#xff1a;注释掉 diff --git a/frameworks/base/core/jni/com_android_internal_os_Zygote.cpp b/frameworks/base/core/jni/com_android_internal_os_…

从资金到未来:技术融资如何重塑IT顾问在AI与网络安全的角色?

一方面是人工智能 &#xff08;AI&#xff09; 和机器学习 &#xff08;ML&#xff09; 的双引擎&#xff0c;另一方面是网络安全和数据泄露威胁中不断变化的威胁形势&#xff0c;IT 格局正在经历翻天覆地的变化。这场数字革命对 IT 顾问来说既是挑战也是机遇&#xff0c;但要成…

三级_网络技术_09_IP地址规划技术

1.某企业产品部的IP地址块为211.168.15.192/26&#xff0c;市场部的为211.168.15.160/27&#xff0c;财务部的为211.168.15.128/27&#xff0c;这三个地址块经聚合后的地址为()。 211.168.15.0/25 211.168.15.0/26 211.168.15.128/25 211.168.15.128/26 2.若某大学分配给计…

低代码开发在金融系统中的应用研究

低代码开发在金融系统中的实施策略 在金融行业&#xff0c;系统的稳定性、安全性以及数据的完整性是至关重要的考虑要素。因此&#xff0c;低代码开发策略在金融系统中的应用必须遵循一系列精细且严格的实施准则。 明确且精准的业务需求分析是基础。金融系统的复杂性意味着在开…

解决计算机中mfc140u.dll没有被指定在windows上运行

在打开电脑软件时候出现mfc140u.dll丢失或找不到mfc140u.dll怎么办&#xff1f;遇到这个问题相当困扰&#xff0c;mfc140u.dll到底是什么&#xff1f;为什么会出现这个情况&#xff0c;相信很多人都不知道&#xff0c;今天我给大家详细介绍一下mfc140u.dll是什么&#xff0c;为…

【C++修行之道】string类的使用

目录 一.C语言中的字符串 二、标准库中的string类 (了解) 2.1 string类(了解) 2.2 帮助文档阅读 三、 string类的常用接口说明 3.1 string类对象的常见构造 3.2 string类对象的容量操作 3.3 string类对象的访问及遍历操作 字符串类的简单实现 3.4 string类对象的修改…

【论文阅读笔记】ASPS: Augmented Segment Anything Model for Polyp Segmentation

1.论文介绍 ASPS: Augmented Segment Anything Model for Polyp Segmentation ASPS&#xff1a;用于息肉分割的扩展SAM模型 2024年 arxiv Paper Code 2.摘要 息肉分割在结直肠癌诊断中起着至关重要的作用。最近&#xff0c;Segment Anything Model(SAM)的出现利用其在大规模…

视频压缩软件哪个压缩最小,视频用什么软件压缩最小

在数字媒体时代&#xff0c;视频内容的生产与分享已成为生活常态。但随之而来的问题就是&#xff0c;大视频文件占用过多存储空间&#xff0c;上传和分享也变得不便。本文将为你揭示如何将视频压缩到最小&#xff0c;同时保持画质清晰。让我们一起探索吧&#xff01; 下载并文件…

剪辑抽帧技巧有哪些 剪辑抽帧怎么做视频 剪辑抽帧补帧怎么操作 剪辑抽帧有什么用 视频剪辑哪个软件好用在哪里学

打破视频节奏&#xff0c;让作品告别平庸。抽帧剪辑可以改变视频叙事节奏&#xff0c;人为制造冲突、转折、卡顿的效果。这种剪辑方式&#xff0c;不仅可以推进剧情发展&#xff0c;还能吸引观众的注意力&#xff0c;有效防止观影疲劳。有关剪辑抽帧技巧有哪些&#xff0c;剪辑…

python中 is 的意义和用法

在Python中&#xff0c;is 是一个关键字&#xff0c;用于比较两个对象的身份&#xff08;即它们是否是同一个对象&#xff09;。如果两个对象是同一个对象&#xff0c;is 将返回 True&#xff1b;否则返回 False。这与比较两个对象的值是否相等的 操作符不同。 基本用法 a …