Comments (5)
出现这个错误,不知道如何解决,麻烦看到回复一下!
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.
这里 trg 和 src 的类型应该为tensor而不是tuple
from nlp-notebook.
请问在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.
请问在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.
这里 trg 和 src 的类型应该为tensor而不是tuple
请问具体该如何修改呢
from nlp-notebook.
Related Issues (10)
- https://pan.baidu.com/s/1O3GXE3E7-qn9TrdKq1-5cw 提取码:h6vt
- RuntimeError: _th_ceil_out not supported on CUDAType for Long HOT 1
- Lattice-LSTM HOT 1
- Bug HOT 2
- 4.1Seq2Seq HOT 3
- 请问可以加入基于transformer的关键词提取和生成吗?
- AttributeError : 'tuple' has no attribute 'to' HOT 1
- 请问bert中文预训练做4-5的时候的运行时显存要求是多少 HOT 2
- 3-2 'tuple' object has no attribute 'last_hidden_state' HOT 2
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 nlp-notebook.