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

error #4

Open
nnn1988 opened this issue Feb 6, 2019 · 4 comments
Open

error #4

nnn1988 opened this issue Feb 6, 2019 · 4 comments

Comments

@nnn1988
Copy link

nnn1988 commented Feb 6, 2019

Hi
Thank you for sharing this code when I run the code I got this error

While running python3 Train.py, I am getting the following error:

Start training and evaluating ...
Epoch : 1
Traceback (most recent call last):
File "Train.py", line 164, in
train()
File "Train.py", line 93, in train
_, batch_loss, batch_acc = sess.run([model.train, model.loss, model.acc], feed_dict=feed_dict)

Traceback (most recent call last):
File "/home/nujud/Desktop/code/Decomposable-Attention-master/Train.py", line 166, in
train()
File "/home/nujud/Desktop/code/Decomposable-Attention-master/Train.py", line 95, in train
_, batch_loss, batch_acc = sess.run([model.train, model.loss, model.acc], feed_dict=feed_dict)
File "/home/nujud/anaconda2/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/home/nujud/anaconda2/envs/tensorflow-cpu/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1111, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (128,) for Tensor 'premise_mask:0', which has shape '(?, 100)'

please help
Thank you in advance

Looking forward for your reply.
Thanks,

@thefirebanks
Copy link

thefirebanks commented Jun 18, 2019

There seems to be an error in either how the masking array is being built (the shape yielded by the sentences2Index() method in Utils.py is not congruent with the shape initialized in the Decomposable model in Model.py) or how the masking array is being initialized in the first place. I've tried reshaping to get (,100) instead but there are some mask arrays that have less than 100 elements, therefore I just used a try except block to check how many erroneous ones were being produced, and another try except block on the evaluate method() in Train.py to skip the arrays that did not fit.

if you have managed to solve the problem and run the full code please let me know

@thefirebanks
Copy link

Couldn't solve this problem, but found the original code that this repo may have been based from and this one works perfectly: https://github.com/cxncu001/NLI

@voidcentury
Copy link

voidcentury commented Jun 21, 2019

Returning s1MaskList and s2MaskList instead of s1Mask and s2Mask, respectively, in the sentence2Index function seems to work.

@duongkstn
Copy link

thanks @voidcentury and @thefirebanks for great supports

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

4 participants