Git Product home page Git Product logo

Comments (5)

OldMy avatar OldMy commented on May 24, 2024

出现这个错误,不知道如何解决,麻烦看到回复一下!
Prefix dict has been built successfully.
[Train Epoch 0]: 0%| | 0/4 [00:00<?, ?it/s]
Traceback (most recent call last):
File "train_eval.py", line 49, in
trg, src = trg.to(device), src.to(device)
AttributeError: 'tuple' object has no attribute 'to'

from nlp-notebook.

jasoncao11 avatar jasoncao11 commented on May 24, 2024

这里 trg 和 src 的类型应该为tensor而不是tuple

from nlp-notebook.

HelloWorldGitHubUser avatar HelloWorldGitHubUser commented on May 24, 2024

请问在Seq2Seq中,把trg改为tensor类型后,出现以下报错:
Traceback (most recent call last):
File "E:\nlp-notebook-master\4-1.Seq2seq\train_eval.py", line 54, in
trg, src = trg.to(device), src.to(device)
AttributeError: 'NoneType' object has no attribute 'to'
是怎么回事呢? @OldMy @jasoncao11

from nlp-notebook.

aqzwy avatar aqzwy commented on May 24, 2024

请问在Seq2Seq中,把trg改为tensor类型后,出现以下报错: Traceback (most recent call last): File "E:\nlp-notebook-master\4-1.Seq2seq\train_eval.py", line 54, in trg, src = trg.to(device), src.to(device) AttributeError: 'NoneType' object has no attribute 'to' 是怎么回事呢? @OldMy @jasoncao11

for trg, src in pbar: trg, src = trg.to(device), src.to(device) => for i in pbar: trg,src = i.trg.to(device),i.src.to(device)

from nlp-notebook.

wanshenlong avatar wanshenlong commented on May 24, 2024

这里 trg 和 src 的类型应该为tensor而不是tuple

请问具体该如何修改呢

from nlp-notebook.

Related Issues (10)

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.