ratishsp / data2text-entity-py Goto Github PK
View Code? Open in Web Editor NEWCode for ACL 2019 paper on Data-to-text Generation with Entity Modeling
License: MIT License
Code for ACL 2019 paper on Data-to-text Generation with Entity Modeling
License: MIT License
Hello! I'm trying to reproduce the results of this code and I'm getting the following error:
main()
File "train.py", line 494, in main
train_model(model, fields, optim, data_type, model_opt)
File "train.py", line 257, in train_model
train_stats = trainer.train(train_iter, epoch, report_func)
File "/Users/sanjana/destruct/data2text-entity-py/onmt/Trainer.py", line 176, in train
self._gradient_accumulation(
File "/Users/sanjana/destruct/data2text-entity-py/onmt/Trainer.py", line 316, in _gradient_accumulation
batch_stats = self.train_loss.sharded_compute_loss(
File "/Users/sanjana/destruct/data2text-entity-py/onmt/Loss.py", line 122, in sharded_compute_loss
for shard in shards(shard_state, shard_size):
File "/Users/sanjana/destruct/data2text-entity-py/onmt/Loss.py", line 265, in shards
torch.autograd.backward(inputs, grads, retain_graph=True)
File "/Users/sanjana/miniconda3/lib/python3.8/site-packages/torch/autograd/__init__.py", line 125, in backward
Variable._execution_engine.run_backward(
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [1200, 600]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
Any guidance would be really appreciated. Thank you! @ratishsp
Hi, when I use your code, there is a problem, it's "Not all arguments have the same value:", which is caused by aeq(sourceL, src_len)
in GlobalAttention.py. And I find that length of entities_list and src data , which is 602 and 606 respectively. Apparently, this is because of <unk>,<blank>,</s> and <s>.
But when I restrict the length of src data to 602, the model could run normally, but the score of RG/CS/CO is too low.
Please help me .
In the DataSet Section of the ReadMe.
I could not find the file "create_dataset.py" in the boxscore-data
mentioned in
"The input dataset for data2text-plan-py can be created by running the script create_dataset.py in scripts folder."
Hi @ratishsp,
Is it possible to upload the code for creating txt files for training/validation/testing for MLB data?
Something similar to this: https://github.com/ratishsp/data2text-entity-py/blob/master/scripts/create_dataset.py
And also, script for the template-based system on MLB dataset.
Thanks in advance.
Hi,
When I run the evalution with
CUDA_VISIBLE_DEVICES=6 ~/torch/install/bin/th extractor.lua -gpuid 1 -datafile roto-ie.h5 -preddata drive_data/transform_gen/roto_cc-beam5_gens.h5 -dict_pfx "roto-ie" -just_eval
, I'm faced with the following error.
/root/torch/install/bin/luajit: extractor.lua:574: bad argument #1 to 'copy' (sizes do not match at /root/torch/extra/cutorch/lib/THC/THCTensorCopy.cu:31)
I print the size and find that the size of p (parameters of generated model) is 2234733, and the size of saved_p (parameters from conv1ie-ep6-94-74.t7) is 2141733. How can I solve the problem?
My torch is installed with LuaJIT. The hdf5 is installed with 'luarocks install hdf5'.
Thank you
Yixian
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.