When I run the "python main.py --resume ./checkpoints/Epoch-12.model --test 1"
----Test---
0%| | 0/528 [00:00<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 234, in
test(model, test_data)
File "main.py", line 186, in test
p1, p2 = model(c, cc, q, cq)
File "/Users/liuyancen/anaconda/envs/python36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 206, in call
result = self.forward(*input, **kwargs)
File "/Users/liuyancen/Desktop/NLP/BiDAF/layers/attention_net.py", line 50, in forward
embd_context = self.build_contextual_embd(ctx_c, ctx_w) # (N, T, 2d)
File "/Users/liuyancen/Desktop/NLP/BiDAF/layers/attention_net.py", line 31, in build_contextual_embd
char_embd = self.char_embd_net(x_c) # (N, seq_len, embd_size)
File "/Users/liuyancen/anaconda/envs/python36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 206, in call
result = self.forward(*input, **kwargs)
File "/Users/liuyancen/Desktop/NLP/BiDAF/layers/char_embedding.py", line 35, in forward
x = [F.relu(conv(x)) for conv in self.conv] # (N, Cout, seq_len, c_embd_size-filter_w+1). stride == 1
File "/Users/liuyancen/Desktop/NLP/BiDAF/layers/char_embedding.py", line 35, in
x = [F.relu(conv(x)) for conv in self.conv] # (N, Cout, seq_len, c_embd_size-filter_w+1). stride == 1
File "/Users/liuyancen/anaconda/envs/python36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 206, in call
result = self.forward(*input, **kwargs)
File "/Users/liuyancen/anaconda/envs/python36/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 237, in forward
self.padding, self.dilation, self.groups)
File "/Users/liuyancen/anaconda/envs/python36/lib/python3.6/site-packages/torch/nn/functional.py", line 40, in conv2d
return f(input, weight, bias)
RuntimeError: Given input size: (1x161x1x8). Calculated output size: (100x161x-3x-15). Output size is too small at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/THNN/generic/VolumetricConvolutionMM.c:65
How to fix it?