Coder Social home page Coder Social logo

Comments (2)

yangluojun avatar yangluojun commented on August 22, 2024

File "../V0/modules.py", line 93, in forward
pe_ss = self.pe_ss[(pos_ss).view(-1)+self.max_seq_len].view(size=[batch,max_seq_len,max_seq_len,-1])
IndexError: index 363 is out of bounds for dimension 0 with size 351

和max_seq_len大小有关,作者训练的时候max_seq_len取为训练集和测试集中最大的句子长度,max_seq_len被用于位置向量的编码。如果预测的句子长度超过max_seq_len + 1 的时候就会出错。建议调整flat_main.py中的max_seq_len,并且控制预测句子的长度。

from flat-lattice-transformer.

lvjiujin avatar lvjiujin commented on August 22, 2024

File "../V0/modules.py", line 93, in forward
pe_ss = self.pe_ss[(pos_ss).view(-1)+self.max_seq_len].view(size=[batch,max_seq_len,max_seq_len,-1])
IndexError: index 363 is out of bounds for dimension 0 with size 351

和max_seq_len大小有关,作者训练的时候max_seq_len取为训练集和测试集中最大的句子长度,max_seq_len被用于位置向量的编码。如果预测的句子长度超过max_seq_len + 1 的时候就会出错。建议调整flat_main.py中的max_seq_len,并且控制预测句子的长度。

我想问下,这里(pos_ss).view(-1)+self.max_seq_len 有什么特殊含义吗?

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.