NeuralTripleTranslation icon indicating copy to clipboard operation
NeuralTripleTranslation copied to clipboard

getting error while running baseline training

Open sujit420 opened this issue 6 years ago • 5 comments

I am getting an error in 1st epoch after few batch i.e. Traceback (most recent call last): File "baselines/main.py", line 206, in main() File "baselines/main.py", line 196, in main experiment.train(learning_rate=0.01) File "baselines/main.py", line 103, in train outputs = self.model(inputs, seq_lengths) File "/Users/sujit.mishra/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/Users/sujit.mishra/NeuralTripleTranslation/baselines/lstm_classifier.py", line 108, in forward outputs, _ = self.rnn(inputs, h0) File "/Users/sujit.mishra/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/Users/sujit.mishra/py36/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 175, in forward self.check_forward_args(input, hx, batch_sizes) File "/Users/sujit.mishra/py36/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 131, in check_forward_args expected_input_dim, input.dim())) RuntimeError: input must have 3 dimensions, got 2

Please help @YueLiu

Thanks

sujit420 avatar Dec 19 '18 09:12 sujit420

can you please help @YueLiu

sujit420 avatar Dec 25 '18 09:12 sujit420

Hi @sujit420 please check the dimensions of your input to the rnn model. It should be 3-dim and use batch as the first dim.

gychant avatar Feb 11 '19 02:02 gychant

@sujit420 can you send us your inputs? thanks

YueLiu avatar Feb 13 '19 23:02 YueLiu

@sujit420 how did you get data/split/train.pkl and data/split/test.pkl files?

petrLorenc avatar Nov 06 '19 15:11 petrLorenc

Hi, I don't know if this is still useful for someone, but this error depends on the wiki_dbpedia_train.txt file. In some lines of this file there are too many tabs instead of one, so this generates an error. I'm attaching here the corrected file. wiki_dbpedia_train.txt

giusidp avatar Jul 03 '22 19:07 giusidp