Comments (6)
max_seq_len指的是seq最大长度为max_seq_len。假如max_seq_len=256:
在padding的时候,如果一个batch内样本最大长度为300,则所有样本会截取padding到256;
如果一个batch内样本最大长度为200,则所有样本会padding到200。
max_seq_len只是限制最大seq_len,当batch内样本长 < max_seq_len 则按照样本最大长度,否则就截取到max_seq_len。
ernie_pyreader读取不同batch时支持seq_len变化,不会有影响。
from paddlenlp.
max_seq_len指的是seq最大长度为max_seq_len。假如max_seq_len=256:
在padding的时候,如果一个batch内样本最大长度为300,则所有样本会截取padding到256;
如果一个batch内样本最大长度为200,则所有样本会padding到200。max_seq_len只是限制最大seq_len,当batch内样本长 < max_seq_len 则按照样本最大长度,否则就截取到max_seq_len。
ernie_pyreader读取不同batch时支持seq_len变化,不会有影响。
def ernie_pyreader(args, pyreader_name):
"""define standard ernie pyreader"""
src_ids = fluid.data(
name='1', shape=[-1, args.max_seq_len, 1], dtype='int64')
sent_ids = fluid.data(
name='2', shape=[-1, args.max_seq_len, 1], dtype='int64')
pos_ids = fluid.data(
name='3', shape=[-1, args.max_seq_len, 1], dtype='int64')
input_mask = fluid.data(
name='4', shape=[-1, args.max_seq_len, 1], dtype='float32')
ernie_pyreader里要求数据seq_len为args.max_seq_len
from paddlenlp.
这个不影响pyreader对数据的读入和后面网络的运行,运行时会根据真实的shape来跑
from paddlenlp.
这个不影响pyreader对数据的读入和后面网络的运行,运行时会根据真实的shape来跑
Error Message Summary:
InvalidArgumentError: The fed Variable src_ids should have dimensions = 3, shape = [-1, 256, 1], but received fed shape [4, 191, 1]
运行报这个错了
from paddlenlp.
参考一下这个PR PaddlePaddle/models#4790
from paddlenlp.
PaddlePaddle/models#4790 解决了这个问题,应该可以关闭当前 issue?
from paddlenlp.
Related Issues (20)
- [Question]: 为什么判断attn_mask是否为causal是通过比较上三角矩阵的方式? HOT 1
- [Bug]: 权重加载导致的主机内存不足 HOT 3
- [Bug]: NER分析GPU环境使用CPU报错,提示(InvalidArgument) Variable value (input) of OP(fluid.layers.embedding) HOT 1
- [Bug]: 关于训练PaddleNLP/model_zoo /ernie-layout/下面 XFUND-ZH Train出现的问题。 HOT 2
- from PaddleNLP.llm.chatglm.predict_generation import Predictor导入失败 HOT 3
- [Question]: 文本分类时,taskflow推理gpu和cpu推理结果非常不一致,cpu推理结果还不稳定 HOT 2
- Mac M芯片的电脑怎么使用 HOT 7
- [Question]: 无法安装paddlenlp2.7及2.8版 HOT 4
- 在进行多分类任务,裁剪操作的时候,报错了 ValueError: too many values to unpack (expected 3) HOT 1
- [Bug]: pipelines的document_stores.faiss中vector_id更新出错 HOT 1
- [Question]: 怎么查看文本分类的训练日志 HOT 1
- [Question]:在xpu上使用taskflow预测时间过长 HOT 1
- [Question]: 无法安装tool_helpers依赖 HOT 1
- [Bug]: Llama3无法生成eos_token HOT 3
- [Question]:chatglmv2无法正确初始化 HOT 1
- [Question]: uie-base模型在昇腾服务器上训练错误 HOT 1
- [Bug]: 昇腾npu训练uie-base模型报错 HOT 1
- [Question]: 是否有脱离paddle和paddlenlp的分词库? HOT 1
- [Question]: ernie-health-chinese output HOT 4
- [Bug]: NER cpu运行极其不稳定,相同输入每次结果都不一样 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paddlenlp.