data2textwithauxiliarysupervision's People
data2textwithauxiliarysupervision's Issues
TypeError: 'NoneType' object is not iterable
作者你好,我最近跑你的代码,但是在跑train.sh会有如下的报错:
Traceback (most recent call last):
File "train.py", line 544, in
main()
File "train.py", line 520, in main
fields = load_fields(first_dataset, data_type, checkpoint, cal_indices=opt.cal_indices)
File "train.py", line 404, in load_fields
fields = dict([(k, f) for (k, f) in fields
TypeError: 'NoneType' object is not iterable
主要就是变量fields的问题,代码里说fields不能迭代,而我debug的时候fields是空的,这个问题改了好久也没有解决,实在是没有办法了麻烦一下你,提前谢谢了
直接运行会报target.view()出现错误,之后改成.reshape(),或者.contiguous().view(),的时候还会报下面第二个错误
直接运行会报target.view()出现错误,之后改成.reshape(),或者.contiguous().view(),的时候还会报下面第二个错误
Traceback (most recent call last):
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/train.py", line 556, in
main()
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/train.py", line 548, in main
train_model(model1, model2, fields, optim1, optim2, data_type, model_opt)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/train.py", line 297, in train_model
train_stats, train_stats2 = trainer.train(train_iter, epoch, report_func)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Trainer.py", line 294, in train
self._gradient_accumulation_basic_encdec(true_batchs, total_stats2, report_stats2, normalization)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Trainer.py", line 513, in _gradient_accumulation_basic_encdec
batch_stats = self.train_loss2.sharded_compute_loss(
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Loss.py", line 136, in sharded_compute_loss
loss, stats = self._compute_loss(batch, **shard)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/modules/CopyGenerator.py", line 204, in _compute_loss
target = target.view(-1)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
改成.reshape(),或者.contiguous().view(),的时候
Traceback (most recent call last):
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/train.py", line 556, in
main()
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/train.py", line 548, in main
train_model(model1, model2, fields, optim1, optim2, data_type, model_opt)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/train.py", line 297, in train_model
train_stats, train_stats2 = trainer.train(train_iter, epoch, report_func)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Trainer.py", line 294, in train
self._gradient_accumulation_basic_encdec(true_batchs, total_stats2, report_stats2, normalization)
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Trainer.py", line 513, in _gradient_accumulation_basic_encdec
batch_stats = self.train_loss2.sharded_compute_loss(
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Loss.py", line 135, in sharded_compute_loss
for shard in shards(shard_state, shard_size, retain_graph=retain_graph):
File "/home/qiansh/data2text/Data2TextWithAuxiliarySupervision/onmt/Loss.py", line 299, in shards
torch.autograd.backward(inputs, grads, retain_graph=retain_graph)
File "/home/qiansh/anaconda3/envs/qsh/lib/python3.9/site-packages/torch/autograd/init.py", line 130, in backward
Variable._execution_engine.run_backward(
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1200, 6
00]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that f
ailed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
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.