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

Problems in the process of reproducing the code #44

Open
ChenJing-825 opened this issue Jul 3, 2021 · 5 comments
Open

Problems in the process of reproducing the code #44

ChenJing-825 opened this issue Jul 3, 2021 · 5 comments

Comments

@ChenJing-825
Copy link

Thank you for open-sourcing the code!
In the process of reproducing, the following problems appeared:
Error(s) in loading state_dict for BertForSequenceClassification:
size mismatch for classifier.weight: copying a param with shape torch.Size([4, 768]) from checkpoint, the shape in current model is torch.Size([2, 768]).
size mismatch for classifier.bias: copying a param with shape torch.Size([4]) from checkpoint, the shape in current model is torch.Size([2]).

I haven't solved it, can you help me? Thanks!

@jind11
Copy link
Owner

jind11 commented Jul 5, 2021

Hi, this error came out when you were loading the model parameters. Could you re-check the number of labels in the model configuration (currently you are using 2)? It should match the model parameters, which is 4 for the number of labels.

@dp0d
Copy link

dp0d commented Oct 18, 2021

Thank you for the code!
I will appreciate it if you could explain the logic of the version of python, cause I can't run the code successfully. When I turn to run the setup.py file in the ESIM folder, message tells me to use python3.7. Could you please run the code again and help me with the base environment to run?

@jind11
Copy link
Owner

jind11 commented Oct 19, 2021

As mentioned in the requirements.txt file, the python version should be 3.6

@dp0d
Copy link

dp0d commented Oct 19, 2021

Thank you for your answer sincerely, however, I still can't run this code. Python3.7 is required, I have tried all the environment foundation like docker, pyenv, conda, it didn't work. Maybe I should try to change the code for my machine to run. Anyway, thanks agin.
WD7N3F6Z G}5% 3(TX$ZTTW

@jind11
Copy link
Owner

jind11 commented Oct 19, 2021

When I wrote this code, I used python 3.6 so I am sure it should work.

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

3 participants