【InternLM 笔记】使用InternStudio 体验书生·浦语2-chat-1.8b随记

news2024/9/22 5:35:59

书生·浦语2-chat-1.8b

介绍

书生·浦语-1.8B (InternLM2-1.8B) 是第二代浦语模型系列的18亿参数版本。为了方便用户使用和研究,书生·浦语-1.8B (InternLM2-1.8B) 共有三个版本的开源模型,他们分别是:

  • InternLM2-1.8B: 具有高质量和高适应灵活性的基础模型,为下游深度适应提供了良好的起点。
  • InternLM2-Chat-1.8B-SFT:在 InternLM2-1.8B 上进行监督微调 (SFT) 后得到的对话模型。
  • InternLM2-Chat-1.8B:通过在线 RLHF 在 InternLM2-Chat-1.8B-SFT 之上进一步对齐。 InternLM2-Chat-1.8B表现出更好的指令跟随、聊天体验和函数调用,推荐下游应用程序使用。

InternLM2 模型具备以下的技术特点

  • 有效支持20万字超长上下文:模型在20万字长输入中几乎完美地实现长文“大海捞针”,而且在 LongBench 和 L-Eval 等长文任务中的表现也达到开源模型中的领先水平。
  • 综合性能全面提升:各能力维度相比上一代模型全面进步,在推理、数学、代码等方面的能力提升显著。

体验过程

体验使用https://studio.intern-ai.org.cn/进行体验

准备环境

拉取环境

/root/share/install_conda_env_internlm_base.sh internlm-demo  # 执行该脚本文件来安装项目实验环境

激活环境

conda activate internlm-demo

安装运行 demo 所需要的依赖

# 升级pip
python -m pip install --upgrade pip

pip install modelscope==1.9.5
pip install transformers==4.35.2
pip install streamlit==1.24.0
pip install sentencepiece==0.1.99
pip install accelerate==0.24.1

模型下载

从魔塔社区下载模型
文件名:download_model.py

import torch
from modelscope import snapshot_download, AutoModel, AutoTokenizer
import os
model_dir = snapshot_download('jayhust/internlm2-chat-1_8b', cache_dir='/root/model', revision='master')

模型会下载到/root/model文件夹下,完整路径:/root/model/jayhust/internlm2-chat-1_8b

运行

使用终端体验代码

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM


model_name_or_path = "/root/model/jayhust/internlm2-chat-1_8b"

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map='auto')
model = model.eval()

system_prompt = """You are an AI assistant whose name is InternLM (书生·浦语).
- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.
- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.
"""

messages = [(system_prompt, '')]

print("=============Welcome to InternLM chatbot, type 'exit' to exit.=============")

while True:
    input_text = input("User  >>> ")
    input_text = input_text.replace(' ', '')
    if input_text == "exit":
        break
    response, history = model.chat(tokenizer, input_text, history=messages)
    messages.append((input_text, response))
    print(f"robot >>> {response}")

运行结果:
在这里插入图片描述

WEB方式运行

cd /root/code
git clone https://gitee.com/internlm/InternLM.git
cd InternLM
git checkout 3028f07cb79e5b1d7342f4ad8d11efad3fd13d17
cd /root/code/InternLM
streamlit run web_demo.py --server.address 127.0.0.1 --server.port 6006

OpenCompass模型评测

准备环境

安装conda环境

conda create --name opencompass --clone=/root/share/conda_envs/internlm-base
conda activate opencompass
git clone https://github.com/open-compass/opencompass
cd opencompass
pip install -e .

安装依赖

pip install protobuf

数据准备

cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/
unzip OpenCompassData-core-20231110.zip

启动评测

python run.py --datasets ceval_gen --hf-path /root/model/jayhust/internlm2-chat-1_8b --tokenizer-path /root/model/jayhust/internlm2-chat-1_8b --tokenizer-kwargs padding_side='left' truncation='left' trust_remote_code=True --model-kwargs trust_remote_code=True device_map='auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug

评测结果:

20240302_122143
tabulate format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dataset                                         version    metric         mode      opencompass.models.huggingface.HuggingFace_jayhust_internlm2-chat-1_8b
----------------------------------------------  ---------  -------------  ------  ------------------------------------------------------------------------
ceval-computer_network                          db9ce2     accuracy       gen                                                                        26.32
ceval-operating_system                          1c2571     accuracy       gen                                                                        36.84
ceval-computer_architecture                     a74dad     accuracy       gen                                                                        14.29
ceval-college_programming                       4ca32a     accuracy       gen                                                                        13.51
ceval-college_physics                           963fa8     accuracy       gen                                                                        36.84
ceval-college_chemistry                         e78857     accuracy       gen                                                                        12.5
ceval-advanced_mathematics                      ce03e2     accuracy       gen                                                                        10.53
ceval-probability_and_statistics                65e812     accuracy       gen                                                                        33.33
ceval-discrete_mathematics                      e894ae     accuracy       gen                                                                        18.75
ceval-electrical_engineer                       ae42b9     accuracy       gen                                                                        27.03
ceval-metrology_engineer                        ee34ea     accuracy       gen                                                                        50
ceval-high_school_mathematics                   1dc5bf     accuracy       gen                                                                         5.56
ceval-high_school_physics                       adf25f     accuracy       gen                                                                        31.58
ceval-high_school_chemistry                     2ed27f     accuracy       gen                                                                        42.11
ceval-high_school_biology                       8e2b9a     accuracy       gen                                                                        15.79
ceval-middle_school_mathematics                 bee8d5     accuracy       gen                                                                        15.79
ceval-middle_school_biology                     86817c     accuracy       gen                                                                        57.14
ceval-middle_school_physics                     8accf6     accuracy       gen                                                                        36.84
ceval-middle_school_chemistry                   167a15     accuracy       gen                                                                        60
ceval-veterinary_medicine                       b4e08d     accuracy       gen                                                                        43.48
ceval-college_economics                         f3f4e6     accuracy       gen                                                                        43.64
ceval-business_administration                   c1614e     accuracy       gen                                                                        36.36
ceval-marxism                                   cf874c     accuracy       gen                                                                        78.95
ceval-mao_zedong_thought                        51c7a4     accuracy       gen                                                                        45.83
ceval-education_science                         591fee     accuracy       gen                                                                        68.97
ceval-teacher_qualification                     4e4ced     accuracy       gen                                                                        68.18
ceval-high_school_politics                      5c0de2     accuracy       gen                                                                        47.37
ceval-high_school_geography                     865461     accuracy       gen                                                                        36.84
ceval-middle_school_politics                    5be3e7     accuracy       gen                                                                        57.14
ceval-middle_school_geography                   8a63be     accuracy       gen                                                                        58.33
ceval-modern_chinese_history                    fc01af     accuracy       gen                                                                        60.87
ceval-ideological_and_moral_cultivation         a2aa4a     accuracy       gen                                                                        68.42
ceval-logic                                     f5b022     accuracy       gen                                                                        31.82
ceval-law                                       a110a1     accuracy       gen                                                                        20.83
ceval-chinese_language_and_literature           0f8b68     accuracy       gen                                                                        17.39
ceval-art_studies                               2a1300     accuracy       gen                                                                        51.52
ceval-professional_tour_guide                   4e673e     accuracy       gen                                                                        62.07
ceval-legal_professional                        ce8787     accuracy       gen                                                                        30.43
ceval-high_school_chinese                       315705     accuracy       gen                                                                        21.05
ceval-high_school_history                       7eb30a     accuracy       gen                                                                        70
ceval-middle_school_history                     48ab4a     accuracy       gen                                                                        72.73
ceval-civil_servant                             87d061     accuracy       gen                                                                        38.3
ceval-sports_science                            70f27b     accuracy       gen                                                                        47.37
ceval-plant_protection                          8941f9     accuracy       gen                                                                        45.45
ceval-basic_medicine                            c409d6     accuracy       gen                                                                        57.89
ceval-clinical_medicine                         49e82d     accuracy       gen                                                                        40.91
ceval-urban_and_rural_planner                   95b885     accuracy       gen                                                                        45.65
ceval-accountant                                002837     accuracy       gen                                                                        38.78
ceval-fire_engineer                             bc23f5     accuracy       gen                                                                        38.71
ceval-environmental_impact_assessment_engineer  c64e2d     accuracy       gen                                                                        38.71
ceval-tax_accountant                            3a5e3c     accuracy       gen                                                                        32.65
ceval-physician                                 6e277d     accuracy       gen                                                                        38.78
ceval-stem                                      -          naive_average  gen                                                                        29.41
ceval-social-science                            -          naive_average  gen                                                                        54.16
ceval-humanities                                -          naive_average  gen                                                                        46.1
ceval-other                                     -          naive_average  gen                                                                        42.11
ceval-hard                                      -          naive_average  gen                                                                        23.9
ceval                                           -          naive_average  gen                                                                        40.39
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

-------------------------------------------------------------------------------------------------------------------------------- THIS IS A DIVIDER --------------------------------------------------------------------------------------------------------------------------------

csv format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dataset,version,metric,mode,opencompass.models.huggingface.HuggingFace_jayhust_internlm2-chat-1_8b
ceval-computer_network,db9ce2,accuracy,gen,26.32
ceval-operating_system,1c2571,accuracy,gen,36.84
ceval-computer_architecture,a74dad,accuracy,gen,14.29
ceval-college_programming,4ca32a,accuracy,gen,13.51
ceval-college_physics,963fa8,accuracy,gen,36.84
ceval-college_chemistry,e78857,accuracy,gen,12.50
ceval-advanced_mathematics,ce03e2,accuracy,gen,10.53
ceval-probability_and_statistics,65e812,accuracy,gen,33.33
ceval-discrete_mathematics,e894ae,accuracy,gen,18.75
ceval-electrical_engineer,ae42b9,accuracy,gen,27.03
ceval-metrology_engineer,ee34ea,accuracy,gen,50.00
ceval-high_school_mathematics,1dc5bf,accuracy,gen,5.56
ceval-high_school_physics,adf25f,accuracy,gen,31.58
ceval-high_school_chemistry,2ed27f,accuracy,gen,42.11
ceval-high_school_biology,8e2b9a,accuracy,gen,15.79
ceval-middle_school_mathematics,bee8d5,accuracy,gen,15.79
ceval-middle_school_biology,86817c,accuracy,gen,57.14
ceval-middle_school_physics,8accf6,accuracy,gen,36.84
ceval-middle_school_chemistry,167a15,accuracy,gen,60.00
ceval-veterinary_medicine,b4e08d,accuracy,gen,43.48
ceval-college_economics,f3f4e6,accuracy,gen,43.64
ceval-business_administration,c1614e,accuracy,gen,36.36
ceval-marxism,cf874c,accuracy,gen,78.95
ceval-mao_zedong_thought,51c7a4,accuracy,gen,45.83
ceval-education_science,591fee,accuracy,gen,68.97
ceval-teacher_qualification,4e4ced,accuracy,gen,68.18
ceval-high_school_politics,5c0de2,accuracy,gen,47.37
ceval-high_school_geography,865461,accuracy,gen,36.84
ceval-middle_school_politics,5be3e7,accuracy,gen,57.14
ceval-middle_school_geography,8a63be,accuracy,gen,58.33
ceval-modern_chinese_history,fc01af,accuracy,gen,60.87
ceval-ideological_and_moral_cultivation,a2aa4a,accuracy,gen,68.42
ceval-logic,f5b022,accuracy,gen,31.82
ceval-law,a110a1,accuracy,gen,20.83
ceval-chinese_language_and_literature,0f8b68,accuracy,gen,17.39
ceval-art_studies,2a1300,accuracy,gen,51.52
ceval-professional_tour_guide,4e673e,accuracy,gen,62.07
ceval-legal_professional,ce8787,accuracy,gen,30.43
ceval-high_school_chinese,315705,accuracy,gen,21.05
ceval-high_school_history,7eb30a,accuracy,gen,70.00
ceval-middle_school_history,48ab4a,accuracy,gen,72.73
ceval-civil_servant,87d061,accuracy,gen,38.30
ceval-sports_science,70f27b,accuracy,gen,47.37
ceval-plant_protection,8941f9,accuracy,gen,45.45
ceval-basic_medicine,c409d6,accuracy,gen,57.89
ceval-clinical_medicine,49e82d,accuracy,gen,40.91
ceval-urban_and_rural_planner,95b885,accuracy,gen,45.65
ceval-accountant,002837,accuracy,gen,38.78
ceval-fire_engineer,bc23f5,accuracy,gen,38.71
ceval-environmental_impact_assessment_engineer,c64e2d,accuracy,gen,38.71
ceval-tax_accountant,3a5e3c,accuracy,gen,32.65
ceval-physician,6e277d,accuracy,gen,38.78
ceval-stem,-,naive_average,gen,29.41
ceval-social-science,-,naive_average,gen,54.16
ceval-humanities,-,naive_average,gen,46.10
ceval-other,-,naive_average,gen,42.11
ceval-hard,-,naive_average,gen,23.90
ceval,-,naive_average,gen,40.39
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

-------------------------------------------------------------------------------------------------------------------------------- THIS IS A DIVIDER --------------------------------------------------------------------------------------------------------------------------------

raw format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------------
Model: opencompass.models.huggingface.HuggingFace_jayhust_internlm2-chat-1_8b
ceval-computer_network: {'accuracy': 26.31578947368421}
ceval-operating_system: {'accuracy': 36.84210526315789}
ceval-computer_architecture: {'accuracy': 14.285714285714285}
ceval-college_programming: {'accuracy': 13.513513513513514}
ceval-college_physics: {'accuracy': 36.84210526315789}
ceval-college_chemistry: {'accuracy': 12.5}
ceval-advanced_mathematics: {'accuracy': 10.526315789473683}
ceval-probability_and_statistics: {'accuracy': 33.33333333333333}
ceval-discrete_mathematics: {'accuracy': 18.75}
ceval-electrical_engineer: {'accuracy': 27.027027027027028}
ceval-metrology_engineer: {'accuracy': 50.0}
ceval-high_school_mathematics: {'accuracy': 5.555555555555555}
ceval-high_school_physics: {'accuracy': 31.57894736842105}
ceval-high_school_chemistry: {'accuracy': 42.10526315789473}
ceval-high_school_biology: {'accuracy': 15.789473684210526}
ceval-middle_school_mathematics: {'accuracy': 15.789473684210526}
ceval-middle_school_biology: {'accuracy': 57.14285714285714}
ceval-middle_school_physics: {'accuracy': 36.84210526315789}
ceval-middle_school_chemistry: {'accuracy': 60.0}
ceval-veterinary_medicine: {'accuracy': 43.47826086956522}
ceval-college_economics: {'accuracy': 43.63636363636363}
ceval-business_administration: {'accuracy': 36.36363636363637}
ceval-marxism: {'accuracy': 78.94736842105263}
ceval-mao_zedong_thought: {'accuracy': 45.83333333333333}
ceval-education_science: {'accuracy': 68.96551724137932}
ceval-teacher_qualification: {'accuracy': 68.18181818181817}
ceval-high_school_politics: {'accuracy': 47.368421052631575}
ceval-high_school_geography: {'accuracy': 36.84210526315789}
ceval-middle_school_politics: {'accuracy': 57.14285714285714}
ceval-middle_school_geography: {'accuracy': 58.333333333333336}
ceval-modern_chinese_history: {'accuracy': 60.86956521739131}
ceval-ideological_and_moral_cultivation: {'accuracy': 68.42105263157895}
ceval-logic: {'accuracy': 31.818181818181817}
ceval-law: {'accuracy': 20.833333333333336}
ceval-chinese_language_and_literature: {'accuracy': 17.391304347826086}
ceval-art_studies: {'accuracy': 51.515151515151516}
ceval-professional_tour_guide: {'accuracy': 62.06896551724138}
ceval-legal_professional: {'accuracy': 30.434782608695656}
ceval-high_school_chinese: {'accuracy': 21.052631578947366}
ceval-high_school_history: {'accuracy': 70.0}
ceval-middle_school_history: {'accuracy': 72.72727272727273}
ceval-civil_servant: {'accuracy': 38.297872340425535}
ceval-sports_science: {'accuracy': 47.368421052631575}
ceval-plant_protection: {'accuracy': 45.45454545454545}
ceval-basic_medicine: {'accuracy': 57.89473684210527}
ceval-clinical_medicine: {'accuracy': 40.909090909090914}
ceval-urban_and_rural_planner: {'accuracy': 45.65217391304348}
ceval-accountant: {'accuracy': 38.775510204081634}
ceval-fire_engineer: {'accuracy': 38.70967741935484}
ceval-environmental_impact_assessment_engineer: {'accuracy': 38.70967741935484}
ceval-tax_accountant: {'accuracy': 32.6530612244898}
ceval-physician: {'accuracy': 38.775510204081634}
ceval-stem: {'naive_average': 29.410892033746723}
ceval-social-science: {'naive_average': 54.161475396956334}
ceval-humanities: {'naive_average': 46.102931026874565}
ceval-other: {'naive_average': 42.10911608938226}
ceval-hard: {'naive_average': 23.89894005847953}
ceval: {'naive_average': 40.387790633140824}
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

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

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

相关文章

找不到emp.dll如何处理?emp.dll丢失的多种的解决方法分享

在计算机游戏中,当特定的核心文件emp.dll发生丢失时,可能会引发一系列影响游戏运行的问题。由于emp.dll通常是游戏运行所必需的动态链接库文件,它的缺失会导致游戏无法正常启动或加载,玩家可能面临“无法进入游戏”的尴尬境地。其…

AI技术初探:普通人ALL IN AI入门指南

自从去年ChatGPT如流星划过夜空,照亮了整个AI领域,它所带来的技术革新与热潮仿佛一场无声的暴风雨,席卷了全球的科技圈。身为一名低阶IT从业者,感觉这太高大上了,与我的工作有毛线关系。 但是,AI技术的飞速…

【海贼王的数据航海:利用数据结构成为数据海洋的霸主】链表—双向链表

目录 往期 1 -> 带头双向循环链表(双链表) 1.1 -> 接口声明 1.2 -> 接口实现 1.2.1 -> 双向链表初始化 1.2.2 -> 动态申请一个结点 1.2.3 -> 双向链表销毁 1.2.4 -> 双向链表打印 1.2.5 -> 双向链表判空 1.2.6 -> 双向链表尾插 1.2.7 -&…

枚举——完美立方算法

枚举 基于逐个尝试答案的一种问题求解策略 例如:求小于N的最大素数 找不到一个数学公式,使得根据N就可以计算出这个素数 N-1是素数吗?N-2是素数吗? …… 判断N-i是否是素数的问题 转化成求小于N的全部素数(可以用筛法…

2024最佳steam搬砖项目,日入5000,保姆级教程,小白无脑操作

今天给带来的项目是“2024最佳steam搬砖项目,日入5000,保姆级教程,小白无脑操作” 二、项目准备 需要下载如下图所显示的app,一个是steam,一个是国内交易的网易buff 安装好了之后就可以开始实操了,国内外汇…

如何在Linux使用Docker部署Redis并结合内网穿透实现公网远程连接本地数据库

文章目录 前言1. 安装Docker步骤2. 使用docker拉取redis镜像3. 启动redis容器4. 本地连接测试4.1 安装redis图形化界面工具4.2 使用RDM连接测试 5. 公网远程访问本地redis5.1 内网穿透工具安装5.2 创建远程连接公网地址5.3 使用固定TCP地址远程访问 正文开始前给大家推荐个网站…

BUUCTF---[ACTF2020 新生赛]BackupFile1

1.题目描述 2.题目提示backup file ,是备份文件的意思。点开链接,页面提示 3.查看源码没有什么有用信息,也没有登录界面,所以也不会用到蚁剑链接来找备份文件,所以大概率就是通过构造playload来查找备份文件。 4.备份…

Vue.js 深度解析:nextTick 原理与应用

🤍 前端开发工程师、技术日更博主、已过CET6 🍨 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 🕠 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 🍚 蓝桥云课签约作者、上架课程《Vue.js 和 E…

【力扣hot100】刷题笔记Day21

前言 快乐周日,做了个美梦睡了个懒觉,组会前刷刷栈的题吧 20. 有效的括号 - 力扣(LeetCode) 辅助栈 class Solution:def isValid(self, s: str) -> bool:dic {):(,]:[,}:{}st []for c in s:if st and c in dic:if dic[c] …

JavaScript实现鼠标移动特效

关键代码&#xff1a; <script>document.onmousemove function (e) {// 加div节点var div document.createElement(div);div.style.width 5px;div.style.height 5px;// 加img节点var img document.createElement(img);// 将Img追加到div里面。div.appendChild(img);…

LeetCode 刷题 [C++] 第763题.划分字母区间

题目描述 给你一个字符串 s 。我们要把这个字符串划分为尽可能多的片段&#xff0c;同一字母最多出现在一个片段中。 注意&#xff0c;划分结果需要满足&#xff1a;将所有划分结果按顺序连接&#xff0c;得到的字符串仍然是 s 。 返回一个表示每个字符串片段的长度的列表。 …

聊一聊日常开发中如何优雅的避免那无处不在的空指针异常

在Java编程语言中&#xff0c;NullPointerException&#xff08;简称NPE&#xff09;是一种常见的运行时异常&#xff0c;当程序试图访问或操作一个还未初始化&#xff08;即值为null&#xff09;的对象引用时&#xff0c;Java虚拟机就会抛出NullPointerException。如果我们在日…

GO 的 Web 开发系列(六)—— 遍历路径下的文件

文件 IO 处理是程序的基础功能&#xff0c;WEB 程序中通过文件 IO 实现附件的上传与下载。在 GO 中&#xff0c;有多种方式可以遍历文件目录&#xff0c;获取文件路径&#xff0c;本文从使用层面上论述这些函数。 预先准备一个包含子目录的目录&#xff0c;用于遍历测试&#…

YOLOv5-Openvino和ONNXRuntime推理【CPU】

1 环境&#xff1a; CPU&#xff1a;i5-12500 Python&#xff1a;3.8.18 2 安装Openvino和ONNXRuntime 2.1 Openvino简介 Openvino是由Intel开发的专门用于优化和部署人工智能推理的半开源的工具包&#xff0c;主要用于对深度推理做优化。 Openvino内部集成了Opencv、Tens…

政安晨【TypeScript高级用法】(一):类与对象

为了在今后使用Cocos引擎开发虚拟场景&#xff0c;咱们首先要了解TypeScript语言。 政安晨的个人主页&#xff1a;政安晨 欢迎 &#x1f44d;点赞✍评论⭐收藏 收录专栏: AI虚拟世界大讲堂 希望政安晨的博客能够对您有所裨益&#xff0c;如有不足之处&#xff0c;欢迎在评论区提…

NestJS核心成员组成-中间件

关于MiddleWare 从本质来说&#xff0c;我们使用NestJS的时候&#xff0c;有百分之九十的原因是我们只想要一个能提供API的服务&#xff0c;即便是一个简单的由数据库https请求的后台&#xff0c;也能满足百分之九十的人了。 对于有Express以及Koa开发的朋友来说&#xff0c;…

java中的map集合

1.jdk8 Map接口实现类的特点&#xff1a; ①Map与Collection并列存在&#xff0c;用于保存具有映射关系的数据&#xff1a;Key-Value; ②Map中的key与value可以是任何引用类型的数据&#xff0c;会封装到HashMap$Node对象中&#xff1b; ③Map中的key不允许重复&#xff0c;…

【计算机网络】IO多路转接之poll

文章目录 一、poll函数接口二、socket就绪条件三、poll的优点四、poll的缺点五、poll使用案例--只读取数据的server服务器1.err.hpp2.log.hpp3.sock.hpp4.pollServer.hpp5.main.cc 一、poll函数接口 #include <poll.h> int poll(struct pollfd *fds, nfds_t nfds, int t…

YOLOv9独家原创改进|使用可改变核卷积AKConv改进RepNCSPELAN4

专栏介绍&#xff1a;YOLOv9改进系列 | 包含深度学习最新创新&#xff0c;主力高效涨点&#xff01;&#xff01;&#xff01; 一、改进点介绍 AKConv是一种具有任意数量的参数和任意采样形状的可变卷积核&#xff0c;对不规则特征有更好的提取效果。 RepNCSPELAN4是YOLOv9中的…

Pytorch学习 day03(Tensorboard)

Tensorboard Tensorboard能够可视化loss的变化过程&#xff0c;便于我们查看模型的训练状态&#xff0c;也能查看模型当前的输入和输出结果 在Pycharm中&#xff0c;可以通过按住ctrl&#xff0c;并左键点击某个库来进入源文件查看该库的使用方法 SummaryWriter是用来向log_di…