PaddleNLP的环境配置:

PaddleNLP的环境配置:

conda create -n paddle—test python=3.9
conda activate  paddle—test

在这里插入图片描述

python -m pip install paddlepaddle-gpu==2.6.1.post112 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
(paddle—test) (venv) PS D:\work\论文写作\邮件\PaddleNLP-develop> python
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from paddlenlp.transformers import AutoTokenizer, AutoModelForCausalLM
D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\_distutils_hack\__init__.py:36: UserWarning: Setuptools is replacing distutils.warnings.warn("Setuptools is replacing distutils.")
>>> tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-0.5B")
[2024-11-19 15:48:45,051] [    INFO] - The `unk_token` parameter needs to be defined: we use `eos_token` by default.
>>> model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", dtype="float16")
[2024-11-19 15:48:51,240] [    INFO] - We are using <class 'paddlenlp.transformers.qwen2.modeling.Qwen2ForCausalLM'> to load 'Qwen/Qwen2-0.5B'.
[2024-11-19 15:48:51,241] [    INFO] - Loading configuration file C:\Users\Win11\.paddlenlp\models\Qwen/Qwen2-0.5B\config.json
[2024-11-19 15:48:51,241] [    INFO] - Loading weights file from cache at C:\Users\Win11\.paddlenlp\models\Qwen/Qwen2-0.5B\model.safetensors
[2024-11-19 15:48:55,345] [    INFO] - Loaded weights file from disk, setting weights to model.
W1119 15:48:56.299374 25568 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.6, Runtime API Version: 11.2
W1119 15:48:56.797859 25568 dynamic_loader.cc:285] Note: [Recommend] copy cudnn into CUDA installation directory. For instance, download cudnn-10.0-windows10-x64-v7.6.5.32.zip from NVIDIA's official website,
then, unzip it and copy it into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
You should do this according to your CUDA installation directory and CUDNN version.
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\auto\modeling.py", line 794, in from_pretrainedreturn cls._from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\auto\modeling.py", line 342, in _from_pretrainedreturn model_class.from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\model_utils.py", line 2463, in from_pretrainedmodel = cls(config, *init_args, **model_kwargs)File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\utils.py", line 289, in __impl__init_func(self, *args, **kwargs)File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\qwen2\modeling.py", line 1242, in __init__self.qwen2 = Qwen2Model(config)File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\utils.py", line 289, in __impl__init_func(self, *args, **kwargs)File "D:\work\论文写作\邮件\PaddleNLP-develop\paddlenlp\transformers\qwen2\modeling.py", line 897, in __init__self.embed_tokens = nn.Embedding(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\nn\layer\common.py", line 1496, in __init__self.weight = self.create_parameter(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\nn\layer\layers.py", line 781, in create_parameterreturn self._helper.create_parameter(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\layer_helper_base.py", line 430, in create_parameterreturn self.main_program.global_block().create_parameter(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\framework.py", line 4381, in create_parameterinitializer(param, self)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\nn\initializer\initializer.py", line 40, in __call__return self.forward(param, block)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\nn\initializer\xavier.py", line 135, in forwardout_var = _C_ops.uniform(
RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly. (error code is 126)Suggestions:1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.2. Configure third-party dynamic library environment variables as follows:- Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`- Windows: set PATH by `set PATH=XXX; (at ..\paddle\phi\backends\dynload\dynamic_loader.cc:312)

在这里插入图片描述

import paddle
paddle.utils.run_check()
(paddle—test) (venv) PS D:\work\论文写作\邮件\PaddleNLP-develop> python
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
I1119 15:56:13.232272 21360 program_interpreter.cc:212] New Executor is Running.
W1119 15:56:13.264072 21360 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.6, Runtime API Version: 11.2
W1119 15:56:13.264580 21360 dynamic_loader.cc:285] Note: [Recommend] copy cudnn into CUDA installation directory.For instance, download cudnn-10.0-windows10-x64-v7.6.5.32.zip from NVIDIA's official website,
then, unzip it and copy it into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
You should do this according to your CUDA installation directory and CUDNN version.
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\utils\install_check.py", line 273, in run_check_run_static_single(use_cuda, use_xpu, use_custom, custom_device_name)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\utils\install_check.py", line 150, in _run_static_singleexe.run(startup_prog)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\executor.py", line 1746, in runres = self._run_impl(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\executor.py", line 1952, in _run_implret = new_exe.run(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\executor.py", line 831, in runtensors = self._new_exe.run(
RuntimeError: In user code:File "<stdin>", line 1, in <module>File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\utils\install_check.py", line 273, in run_check_run_static_single(use_cuda, use_xpu, use_custom, custom_device_name)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\utils\install_check.py", line 135, in _run_static_singleinput, out, weight = _simple_network()File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\utils\install_check.py", line 31, in _simple_networkweight = paddle.create_parameter(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\tensor\creation.py", line 228, in create_parameterreturn helper.create_parameter(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\layer_helper_base.py", line 444, in create_parameterself.startup_program.global_block().create_parameter(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\framework.py", line 4381, in create_parameterinitializer(param, self)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\nn\initializer\initializer.py", line 40, in __call__return self.forward(param, block)File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\nn\initializer\constant.py", line 84, in forwardop = block.append_op(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\framework.py", line 4467, in append_opop = Operator(File "D:\work\论文写作\邮件\PaddleNLP-develop\venv\lib\site-packages\paddle\base\framework.py", line 3016, in __init__for frame in traceback.extract_stack():PreconditionNotMetError: The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly. (error code is 126)Suggestions:1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.2. Configure third-party dynamic library environment variables as follows:- Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`- Windows: set PATH by `set PATH=XXX; (at ..\paddle\phi\backends\dynload\dynamic_loader.cc:312)[operator < fill_constant > error]
>>>

更换版本

在这里插入图片描述

#python -m pip install paddlepaddle-gpu==2.6.1.post112 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu123/
(paddle—test) (venv) PS D:\work\论文写作\邮件\PaddleNLP-develop> python
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
I1119 16:00:49.811331 25164 program_interpreter.cc:243] New Executor is Running.
W1119 16:00:49.811331 25164 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.6, Runtime API Version: 12.3
W1119 16:00:49.812327 25164 gpu_resources.cc:164] device: 0, cuDNN Version: 9.0.
I1119 16:00:50.964934 25164 interpreter_util.cc:648] Standalone Executor is Used.
PaddlePaddle works well on 1 GPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
>>>>>> from paddlenlp.transformers import AutoTokenizer, AutoModelForCausalLM           
>>> tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-0.5B")                     
[2024-11-19 16:05:28,468] [    INFO] - The `unk_token` parameter needs to be defined: we use `eos_token` by default.
>>> model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", dtype="float16")
[2024-11-19 16:05:36,929] [    INFO] - We are using <class 'paddlenlp.transformers.qwen2.modeling.Qwen2ForCausalLM'> to load 'Qwen/Qwen2-0.5B'.
[2024-11-19 16:05:36,929] [    INFO] - Loading configuration file C:\Users\Win11\.paddlenlp\models\Qwen/Qwen2-0.5B\config.json
[2024-11-19 16:05:36,934] [    INFO] - Loading weights file from cache at C:\Users\Win11\.paddlenlp\models\Qwen/Qwen2-0.5B\model.safetensors
[2024-11-19 16:05:39,705] [    INFO] - Loaded weights file from disk, setting weights to model.
[2024-11-19 16:05:49,260] [    INFO] - All model checkpoint weights were used when initializing Qwen2ForCausalLM.[2024-11-19 16:05:49,260] [ WARNING] - Some weights of Qwen2ForCausalLM were not initialized from the model checkpoint at Qwen/Qwen2-0.5B and are newly initialized: ['lm_head.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
[2024-11-19 16:05:49,261] [    INFO] - Loading configuration file C:\Users\Win11\.paddlenlp\models\Qwen/Qwen2-0.5B\generation_config.json
>>> input_features = tokenizer("你好!请自我介绍一下。", return_tensors="pd")        
>>> outputs = model.generate(**input_features, max_length=128)
>>> print(tokenizer.batch_decode(outputs[0], skip_special_tokens=True))
[' 我是一个AI语言模型,我可以回答各种问题,包括但不限于:天气、新闻、历史、文化、科学、教育、娱乐等。请问您有什么需要了解的吗?']
>>>
`

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

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

相关文章

物联网研究实训室建设方案

一、引言 随着物联网技术的快速发展&#xff0c;其在各个行业的应用越来越广泛&#xff0c;对物联网专业人才的需求也日益增加。为满足这一需求&#xff0c;建设一个符合现代化教学需求的物联网研究实训室&#xff0c;对于提高学生的实践能力和创新能力具有重要意义。本方案旨…

javaweb学习——Day2

JS对象 1、array 定义&#xff1a; var namenew Array(元素列表); var name[元素列表] 访问&#xff1a; name[索引]值 array的属性和方法 length属性&#xff0c;获取数组长度 foreach():遍历数组元素 x.forEach(element > { console.log(element); }); push():…

实战精选|如何使用 OpenVINO™ 在 ElectronJS 中创建桌面应用程序

点击蓝字 关注我们,让开发变得更有趣 作者 | Mikołaj Roszczyk 华沙理工大学物联网工程师 翻译 | 武卓 英特尔 AI 软件布道师 排版 | 吴紫琴 OpenVINO™ 最近&#xff0c;我完成了一个 demo 演示&#xff0c;展示了 OpenVINO™ 在 Node.js 框架中的强大功能。得益于与 Electr…

PyCharm的类型警告: Expected type ‘SupportsWrite[bytes]‘, got ‘BinaryIO‘ instead

记录时使用的PyCharm版本: PyCharm 2024.3 (Professional Edition) Build #PY-243.21565.199, built on November 13, 2024 问题描述 当在PyCharm里使用pickle保存文件, 比如以下代码这样: with open(meta_save_path, wb) as f:pickle.dump(meta, f)会发现PyCharm对此发出类型…

【Docker】快速部署 Pikachu:一个包含常见 Web 安全漏洞的渗透测试练习靶场

系统介绍 Pikachu是一个带有漏洞的Web应用系统&#xff0c;在这里包含了常见的web安全漏洞。 如果你是一个Web渗透测试学习人员且正发愁没有合适的靶场进行练习&#xff0c;那么Pikachu可能正合你意。 Pikachu上的漏洞类型列表如下&#xff1a; Burt Force(暴力破解漏洞) XSS…

vscode 执行 vue 命令无效/禁止运行

在cmd使用命令可以创建vue项目但是在vscode上面使用命令却不行 一、问题描述 在 cmd 中已确认vue、node、npm命令可以识别运行&#xff0c;但是在 vscode 编辑器中 vue 命令被禁止&#xff0c;详细报错为&#xff1a;vue : 无法加载文件 D:\Software\nodejs\node_global\vue.…

【电路笔记 通信】:数字式时分制指令响应型多路传输数据总线 1553协议 289A-97协议

系统及组成 MIL-STD-1553是一种用于航空、航天和军用系统中的多路传输数据总线标准。最初由美国国防部在1973年制定&#xff0c;该标准旨在为军用飞机、导弹和其他嵌入式系统提供可靠的数据通信&#xff0c;现已被广泛应用于航空航天、卫星、舰船、地面车辆以及其他关键任务系统…

npm/cnpm的使用

npm 1、安装npm 前往nodejs官网下载安装node 验证是否安装成功node node -v node安装npm也会安装 npm -v 2、使用npm 1. 初始化项目 在一个项目文件夹中运行&#xff1a; npm init 根据提示输入项目信息&#xff08;如项目名称、版本号等&#xff09;。 如果你希望快速初…

红外相机和RGB相机外参标定 - 无需标定板方案

1. 动机 在之前的文章中红外相机和RGB相机标定&#xff1a;实现两种模态数据融合_红外相机标定-CSDN博客 &#xff0c;介绍了如何利用标定板实现外参标定&#xff1b;但实测下来发现2个问题&#xff1a; &#xff08;1&#xff09;红外标定板尺寸问题&#xff0c;由于标定板小…

web小:在html页面实现多边形按钮

效果如下图所示 主要是使用了clip-path&#xff0c;代码如下 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0">&l…

【蓝桥杯C/C++】翻转游戏:多种实现与解法解析

文章目录 &#x1f4af;题目&#x1f4af;问题分析解法一&#xff1a;减法法解法二&#xff1a;位运算解法解法三&#xff1a;逻辑非解法解法四&#xff1a;条件运算符解法解法五&#xff1a;数组映射法不同解法的比较 &#x1f4af;小结 &#x1f4af;题目 在蓝桥镇&#xff0…

V-rep机器人仿真软件学习笔记

常用的机器人仿真软件有哪些&#xff1f;为什么选择V-rep&#xff1f; 目前常用的机器人物理仿真软件有Gazebo、V-rep、Webots等&#xff0c;这三款都是开源软件&#xff0c;自己使用过前两种&#xff0c;Gazebo配合ROS使用功能十分强大&#xff0c;但是要在Linux系统下使用&am…

第7章 硬件测试-7.1 硬件调试

第7章 硬件测试 7.1 硬件调试7.1.1 电路检查7.1.2 电源调试7.1.3 时钟调试7.1.4 主芯片及外围小系统调试7.1.5 存储器件和串口外设调试7.1.6 其他功能模块调试 测试是每项成功产品的必经环节。硬件测试是评估产品质量的重要方法&#xff0c;产品质量是公司的信誉和品牌象征&…

《深入理解 Spring MVC 工作流程》

一、Spring MVC 架构概述 Spring MVC 是一个基于 Java 的轻量级 Web 应用框架&#xff0c;它遵循了经典的 MVC&#xff08;Model-View-Controller&#xff09;设计模式&#xff0c;将请求、响应和业务逻辑分离&#xff0c;从而构建出灵活可维护的 Web 应用程序。 在 Spring MV…

基于Java Springboot宿舍管理系统

一、作品包含 源码数据库设计文档万字PPT全套环境和工具资源部署教程 二、项目技术 前端技术&#xff1a;Html、Css、Js、Vue、Element-ui 数据库&#xff1a;MySQL 后端技术&#xff1a;Java、Spring Boot、MyBatis 三、运行环境 开发工具&#xff1a;IDEA/eclipse 数据…

LeetCode螺旋矩阵

快一个月没刷题了&#xff0c;最近工作有些忙&#xff0c;今天闲下来两小时&#xff0c;刷一道 题目描述 给你一个 m 行 n 列的矩阵 matrix &#xff0c;请按照 顺时针螺旋顺序 &#xff0c;返回矩阵中的所有元素。 示例 1&#xff1a; 输入&#xff1a;matrix [[1,2,3],[4…

探索CompletableFuture:高效异步编程的利器

目录 一、CompletableFuture基本功能安利 二、CompletableFuture使用介绍 &#xff08;一&#xff09;任务创建使用 1.supplyAsync创建带有返回值的异步任务 2.runAsync创建没有返回值的异步任务 &#xff08;二&#xff09;异步回调使用 1.异步回调&#xff1a;thenApp…

java的强,软,弱,虚引用介绍以及应用

写在前面 本文看下Java的强&#xff0c;软&#xff0c;弱&#xff0c;虚引用相关内容。 1&#xff1a;各种引用介绍 顶层类是java.lang.ref.Reference,注意是一个抽象类&#xff0c;而不是接口&#xff0c;其中比较重要的引用队列ReferenceQueue就在该类中定义&#xff0c;子…

基于STM32的智能垃圾分类投递系统设计

目录 引言系统需求与设计目标硬件设计 3.1 核心控制模块 3.2 传感器模块 3.3 驱动模块 3.4 显示模块 3.5 通信模块软件设计 4.1 数据采集与处理 4.2 垃圾分类逻辑实现 4.3 状态显示与远程监控代码实现 5.1 数据采集与处理 5.2 分类逻辑与控制 5.3 状态显示与通信 5.4 主程序实…

手摸手6-创建前端应用

目录 手摸手6-创建前端应用简介命令 npm create vue 和 npm init vue3的区别 使用 Create-Vue 创建应用1、输入命令 npm create vue 创建应用2、输入命令 npm install 安装相关依赖3、输入命令 npm run dev 运行项目 项目结构 手摸手6-创建前端应用 简介 create-vue 是 vue 应…