seraphinatarrant / plan-write-revise Goto Github PK
View Code? Open in Web Editor NEWCode for a web demo of Plan, Write, and Revise: a neural system for interactive open-domain story generation
License: MIT License
Code for a web demo of Plan, Write, and Revise: a neural system for interactive open-domain story generation
License: MIT License
Hi thanks for the impressive work! Can you share the code for training the model?
Hi,
I am trying to train a title-storyline to story model of plan and write paper using this command:
python pytorch_src/main.py --batch_size 20 --train-data rocstory_plan_write/ROCStories_all_merge_tokenize.titlesepkeysepstory.train --valid-data rocstory_plan_write/ROCStories_all_merge_tokenize.titlesepkeysepstory.dev --test-data rocstory_plan_write/ROCStories_all_merge_tokenize.titlesepkeysepstory.test --dropouti 0.4 --dropouth 0.25 --seed 141 --epoch 500 --emsize 1000 --nhid 1000 --save model.pt --vocab-file vocab.pkl
and I am getting this error:
Producing dataset...
Saved dictionary to vocab.pkl
Applying weight drop of 0.5 to weight_hh_l0
Applying weight drop of 0.5 to weight_hh_l0
Applying weight drop of 0.5 to weight_hh_l0
[WeightDrop(
(module): LSTM(1000, 1000)
), WeightDrop(
(module): LSTM(1000, 1000)
), WeightDrop(
(module): LSTM(1000, 1000)
)]
Using []
Args: Namespace(alpha=2, batch_size=20, beta=1, bptt=70, clip=0.25, cuda=True, dropout=0.4, dropoute=0.1, dropouth=0.25, dropouti=0.4, emsize=1000, epochs=50, log_interval=200, lr=30, model='LSTM', nhid=1000, nlayers=3, nonmono=5, optimizer='sgd', resume='', save='model.pt', seed=141, test_data='rocstory_plan_write/ROCStories_all_merge_tokenize.titlesepkeysepstory.test', tied=True, train_data='rocstory_plan_write/ROCStories_all_merge_tokenize.titlesepkeysepstory.train', valid_data='rocstory_plan_write/ROCStories_all_merge_tokenize.titlesepkeysepstory.dev', vocab_file='vocab.pkl', wdecay=1.2e-06, wdrop=0.5, when=[-1])
Model total parameters: 61965904
/home/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/rnn.py:179: RuntimeWarning: RNN module weights are not part of single contiguous chunk of memory. This means they need to be compacted at every call, possibly greatly increasing memory usage. To compact weights again call flatten_parameters().
self.dropout, self.training, self.bidirectional, self.batch_first)
Traceback (most recent call last):
File "pytorch_src/main.py", line 252, in <module>
train()
File "pytorch_src/main.py", line 208, in train
output, hidden, rnn_hs, dropped_rnn_hs = model(data, hidden, return_h=True)
File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "/home/language-model/pytorch_src/model.py", line 82, in forward
raw_output, new_h = rnn(raw_output, hidden[l])
File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "/home/language-model/pytorch_src/weight_drop.py", line 47, in forward
return self.module.forward(*args)
File "/home/anaconda3/envs/py36/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 179, in forward
self.dropout, self.training, self.bidirectional, self.batch_first)
RuntimeError: shape '[4000000, 1]' is invalid for input of size 4000
I wonder if you have any idea of what is wrong?
Thanks.
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.