Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run time Error regarding input size while training #4

Open
sagin456 opened this issue May 2, 2019 · 5 comments
Open

Run time Error regarding input size while training #4

sagin456 opened this issue May 2, 2019 · 5 comments

Comments

@sagin456
Copy link

sagin456 commented May 2, 2019

I am trying to train the model (after pre-processing was done successfully) using
python run.py train.
I am using running Windows 10, Python 3.6.5, spaCy 2.0.0, pytorch 0.4.0
Unfortunately, I am receiving a run time error .

2019-05-02 18:47:45,082 - [train.py:22-train()] - INFO - ------------MODEL TRAIN--------------
2019-05-02 18:47:45,082 - [train.py:23-train()] - INFO - loading config file...
2019-05-02 18:47:45,082 - [train.py:37-train()] - INFO - reading squad dataset...
2019-05-02 18:47:49,647 - [train.py:40-train()] - INFO - constructing model...
2019-05-02 18:47:50,334 - [train.py:89-train()] - INFO - start training...
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/Match-LSTM/run.py", line 38, in
train(args.config_path)
File "C:\Users\Administrator\PycharmProjects\Match-LSTM\train.py", line 110, in train
device=device)
File "C:\Users\Administrator\PycharmProjects\Match-LSTM\train.py", line 162, in train_on_model
ans_range_prop, _, _ = model.forward(*batch_input)
File "C:\Users\Administrator\PycharmProjects\Match-LSTM\models\match_lstm_plus.py", line 119, in forward
context_encode, _ = self.encoder.forward(context_vec, context_mask)
File "C:\Users\Administrator\PycharmProjects\Match-LSTM\models\layers.py", line 716, in forward
o_pack_dropout, _ = self.hidden.forward(v_pack_dropout)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 178, in forward
self.check_forward_args(input, hx, batch_sizes)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 130, in check_forward_args
self.input_size, input.size(-1)))
RuntimeError: input.size(-1) must be equal to input_size. Expected 373, got 372

Process finished with exit code 1

Would appreciate any help regarding this.
Thanks!

@dzzxjl
Copy link

dzzxjl commented Jun 25, 2019

@sagin456 Have you solve this problem? i meet it too.

@chaoyueziji
Copy link

I also meet it

@Xuehuiquan
Copy link

I am trying to train the model (after pre-processing was done successfully) using
python run.py train.
I am using running Windows 10, Python 3.6.5, spaCy 2.0.0, pytorch 0.4.0,torch.version.cuda 8.0
Unfortunately, I am receiving a run time error .

THCudaCheck FAIL file=C:/ProgramData/Miniconda3/conda-bld/pytorch_1524543037166/work/aten/src/THC/THCTensorCopy.cu line=100 error=4
: unspecified launch failure
Traceback (most recent call last):
File "run.py", line 37, in
train(args.config_path)
File "D:\PycharmProjects\Match-LSTM_R-Net_M-Reader-on-SQuAD\Match-LSTM-master\train.py", line 114, in train
device=device)
File "D:\PycharmProjects\Match-LSTM_R-Net_M-Reader-on-SQuAD\Match-LSTM-master\train.py", line 170, in train_on_model
loss.backward()
File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\autograd_init_.py", line 89, in backward
allow_unreachable=True) # allow_unreachable flag
File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\autograd\function.py", line 76, in apply
return self._forward_cls.backward(self, *args)
File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\nn_functions\packing.py", line 50, in backward
grad_input[i, :bs] = grad_steps[offset:offset + bs]
RuntimeError: cuda runtime error (4) : unspecified launch failure at C:/ProgramData/Miniconda3/conda-bld/pytorch_1524543037166/work/
aten/src/THC/THCTensorCopy.cu:100

@Saipriya6009
Copy link

I am trying to train the model (after pre-processing was done successfully) using python run.py train. I am using running Windows 10, Python 3.6.5, spaCy 2.0.0, pytorch 0.4.0,torch.version.cuda 8.0 Unfortunately, I am receiving a run time error .

THCudaCheck FAIL file=C:/ProgramData/Miniconda3/conda-bld/pytorch_1524543037166/work/aten/src/THC/THCTensorCopy.cu line=100 error=4 : unspecified launch failure Traceback (most recent call last): File "run.py", line 37, in train(args.config_path) File "D:\PycharmProjects\Match-LSTM_R-Net_M-Reader-on-SQuAD\Match-LSTM-master\train.py", line 114, in train device=device) File "D:\PycharmProjects\Match-LSTM_R-Net_M-Reader-on-SQuAD\Match-LSTM-master\train.py", line 170, in train_on_model loss.backward() File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\tensor.py", line 93, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\autograd__init__.py", line 89, in backward allow_unreachable=True) # allow_unreachable flag File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\autograd\function.py", line 76, in apply return self._forward_cls.backward(self, *args) File "C:\Users\xhq\anaconda3\envs\pt0.4\lib\site-packages\torch\nn_functions\packing.py", line 50, in backward grad_input[i, :bs] = grad_steps[offset:offset + bs] RuntimeError: cuda runtime error (4) : unspecified launch failure at C:/ProgramData/Miniconda3/conda-bld/pytorch_1524543037166/work/ aten/src/THC/THCTensorCopy.cu:100

Have you completely run it sir/mam?

@Saipriya6009
Copy link

I am trying to train the model (after pre-processing was done successfully) using python run.py train. I am using running Windows 10, Python 3.6.5, spaCy 2.0.0, pytorch 0.4.0 Unfortunately, I am receiving a run time error .

2019-05-02 18:47:45,082 - [train.py:22-train()] - INFO - ------------MODEL TRAIN-------------- 2019-05-02 18:47:45,082 - [train.py:23-train()] - INFO - loading config file... 2019-05-02 18:47:45,082 - [train.py:37-train()] - INFO - reading squad dataset... 2019-05-02 18:47:49,647 - [train.py:40-train()] - INFO - constructing model... 2019-05-02 18:47:50,334 - [train.py:89-train()] - INFO - start training... Traceback (most recent call last): File "C:/Users/Administrator/PycharmProjects/Match-LSTM/run.py", line 38, in train(args.config_path) File "C:\Users\Administrator\PycharmProjects\Match-LSTM\train.py", line 110, in train device=device) File "C:\Users\Administrator\PycharmProjects\Match-LSTM\train.py", line 162, in train_on_model ans_range_prop, _, _ = model.forward(*batch_input) File "C:\Users\Administrator\PycharmProjects\Match-LSTM\models\match_lstm_plus.py", line 119, in forward context_encode, _ = self.encoder.forward(context_vec, context_mask) File "C:\Users\Administrator\PycharmProjects\Match-LSTM\models\layers.py", line 716, in forward o_pack_dropout, _ = self.hidden.forward(v_pack_dropout) File "C:\Users\Administrator\Anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 178, in forward self.check_forward_args(input, hx, batch_sizes) File "C:\Users\Administrator\Anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 130, in check_forward_args self.input_size, input.size(-1))) RuntimeError: input.size(-1) must be equal to input_size. Expected 373, got 372

Process finished with exit code 1

Would appreciate any help regarding this. Thanks!

Did you rectify this error later and got the results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants