Git Product home page Git Product logo

Comments (2)

gemfield avatar gemfield commented on July 26, 2024

把设备从cuda换成cpu后,错误信息变为:

--------------------------------------------
Traceback (most recent call last):
  File "train.py", line 32, in <module>
    train()
  File "/opt/gemfield/deepvac/deepvac/core/deepvac.py", line 671, in __call__
    self.process()
  File "/opt/gemfield/deepvac/deepvac/core/deepvac.py", line 664, in process
    self.train()
  File "/opt/gemfield/deepvac/deepvac/core/deepvac.py", line 617, in train
    self.doForward()
  File "train.py", line 22, in doForward
    output = self.config.net(self.config.sample, self.src_mask)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/gemfield/hostpv/github/transformer/modules/model_transformer_encoder.py", line 45, in forward
    x = self.encoder(src)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/sparse.py", line 158, in forward
    return F.embedding(
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/functional.py", line 2043, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self

from mlab.

gemfield avatar gemfield commented on July 26, 2024

原因是nn.Embedding(ntoken, emb_size) 前向的时候,输入的索引超过了构造时的ntoken的数量导致的。

from mlab.

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.