Coder Social home page Coder Social logo

Comments (3)

LeeSureman avatar LeeSureman commented on August 22, 2024

句子长度最大是多少?

from flat-lattice-transformer.

qlg-9999 avatar qlg-9999 commented on August 22, 2024

Traceback (most recent call last): File "flat_main.py", line 787, in trainer.train() File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/core/trainer.py", line 613, in train self.callback_manager.on_exception(e) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/core/callback.py", line 309, in wrapper returns.append(getattr(callback, func.name)(*arg)) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/core/callback.py", line 505, in on_exception raise exception # 抛出陌生Error File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/core/trainer.py", line 609, in train self._train() File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/core/trainer.py", line 664, in _train prediction = self._data_forward(self.model, batch_x) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/core/trainer.py", line 752, in _data_forward y = network(**x) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "../V1/models.py", line 440, in forward bert_embed = self.bert_embedding(char_for_bert) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "../fastNLP_module.py", line 389, in forward outputs = self.model(words) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "/raid/ztt/anaconda2/envs/p3/lib/python3.6/site-packages/fastNLP/embeddings/bert_embedding.py", line 339, in forward "After split words into word pieces, the lengths of word pieces are longer than the " RuntimeError: After split words into word pieces, the lengths of word pieces are longer than the maximum allowed sequence length:512 of bert. You can set auto_truncate=True for BertEmbedding to automatically truncate overlong input.
我也出现了这样的情况,将auto_truncate = Ture也不太管用,请问您解决了吗

from flat-lattice-transformer.

LeeSureman avatar LeeSureman commented on August 22, 2024

额,你能把具体送到bert embedd里的序列长度输出给我看一下么

from flat-lattice-transformer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.