allennlp-demo
allennlp-demo copied to clipboard
Missing key(s) in state_dict
When running ./app.py --model masked-lm
I get the following error:
RuntimeError: Error(s) in loading state_dict for MaskedLanguageModel:
Missing key(s) in state_dict: "_language_model_head.bert_lm_head.predictions.decoder.bias".
Setup
When setting up the env as per Readme instructions:
conda create -n allennlp-demo python=3.7
conda activate allennlp-demo
pip install -r requirements.txt
git clone https://github.com/allenai/allennlp-demo/
And then using the allennlp comit specified in the Dockerfile
(17c2ff1ce2cb5e84ab9a0f524e6c01362c242cae
)
git clone https://github.com/allenai/allennlp
cd allennlp
git checkout 17c2ff1ce2cb5e84ab9a0f524e6c01362c242cae
pip install --editable .
Then setting up the demo as:
./scripts/build_demo.py
cd demo
npm run start
And the backend as:
./app.py --model masked-lm
Seeing the same thing
Here's my pip freeze: allennlp===0.9.1-unreleased allennlp-models===0.0.1-unreleased attrs==19.3.0 blis==0.4.1 boto3==1.12.48 botocore==1.15.48 catalogue==1.0.0 certifi==2020.4.5.1 chardet==3.0.4 click==7.1.2 conllu==2.3.2 cymem==2.0.3 docutils==0.15.2 filelock==3.0.12 flaky==3.6.1 Flask==1.1.2 Flask-Cors==3.0.8 future==0.18.2 gevent==20.4.0 greenlet==0.4.15 h5py==2.10.0 idna==2.9 importlib-metadata==1.6.0 itsdangerous==1.1.0 Jinja2==2.11.2 jmespath==0.9.5 joblib==0.14.1 jsonnet==0.15.0 jsonpickle==1.4.1 MarkupSafe==1.1.1 more-itertools==8.2.0 murmurhash==1.0.2 nltk==3.5 numpy==1.18.3 overrides==2.8.0 packaging==20.3 plac==1.1.3 pluggy==0.13.1 preshed==3.0.2 protobuf==3.11.3 psycopg2-binary==2.8.5 py==1.8.1 py-rouge==1.1 pyparsing==2.4.7 pytest==5.4.1 python-dateutil==2.8.1 python-json-logger==0.1.11 pytorch-pretrained-bert==0.6.2 pytz==2020.1 regex==2020.4.4 requests==2.23.0 responses==0.10.14 s3transfer==0.3.3 sacremoses==0.0.41 scikit-learn==0.22.2.post1 scipy==1.4.1 semantic-version==2.8.4 sentencepiece==0.1.86 six==1.14.0 spacy==2.2.4 srsly==1.0.2 tensorboardX==2.0 thinc==7.4.0 tokenizers==0.0.11 torch==1.5.0 tqdm==4.45.0 transformers==2.4.1 urllib3==1.25.9 wasabi==0.6.0 wcwidth==0.1.9 Werkzeug==0.16.1 word2number==1.1 zipp==3.1.0
Is that torch version correct? I've tried a couple, 1.4.0, but no luck there either