-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Hello,
I tried to train new models from scratch, but that wouldn't work. The targetid training would go fine, but then frameid would halt with a NaN error. It would do this at different points in the training, but always eventually did within the first 10% of training or so. None of the issues regarding this were helpful for me.
So, I downloaded the pre-trained models. When I run the pre-trained targetid model over a file of sentences, I see this:
python3 -m sesame.targetid --mode predict --model_name fn1.7-pretrained-targetid --raw_input yc_essential_startup_advice.txt
[dynet] random seed: 1809054107
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
ARGID_LR: 0.0005
DATA_DIRECTORY: data/
DEBUG_MODE: False
EMBEDDINGS_FILE: data/glove.6B.100d.txt
VERSION: 1.7
_____________________
COMMAND: /home/alan/git_projects/open-sesame/sesame/targetid.py --mode predict --model_name fn1.7-pretrained-targetid --raw_input yc_essential_startup_advice.txt
MODEL FOR TEST / PREDICTION: logs/fn1.7-pretrained-targetid/best-targetid-1.7-model
PARSING MODE: predict
_____________________
Reading data/open_sesame_v1_data/fn1.7/fn1.7.fulltext.train.syntaxnet.conll ...
591032it [00:07, 83907.23it/s]
# examples in data/open_sesame_v1_data/fn1.7/fn1.7.fulltext.train.syntaxnet.conll : 19391 in 3413 sents
# examples with missing arguments : 526
Combined 19391 instances in data into 3413 instances.
Reading the lexical unit index file: data/fndata-1.7/luIndex.xml
# unique targets = 9421
# total targets = 13572
# targets with multiple LUs = 4151
# max LUs per target = 5
Reading pretrained embeddings from data/glove.6B.100d.txt ...
PARSER SETTINGS (see logs/fn1.7-pretrained-targetid/configuration.json)
_____________________
DEV_EVAL_EPOCH_FREQUENCY: 3
DROPOUT_RATE: 0.01
EVAL_AFTER_EVERY_EPOCHS: 100
HIDDEN_DIM: 100
LEMMA_DIM: 100
LSTM_DEPTH: 2
LSTM_DIM: 100
LSTM_INPUT_DIM: 100
NUM_EPOCHS: 100
PATIENCE: 25
POS_DIM: 100
PRETRAINED_EMBEDDING_DIM: 100
TOKEN_DIM: 100
TRAIN: data/neural/fn1.7/fn1.7.fulltext.train.syntaxnet.conll
UNK_PROB: 0.1
USE_DROPOUT: True
# Tokens = 410050
Unseen in dev/test = 17
Unlearnt in dev/test = 400017
# POS tags = 45
Unseen in dev/test = 0
Unlearnt in dev/test = 1
# Lemmas = 9349
Unseen in dev/test = 114
Unlearnt in dev/test = 115
_____________________
Reading model from logs/fn1.7-pretrained-targetid/best-targetid-1.7-model ...
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/alan/git_projects/open-sesame/sesame/targetid.py", line 459, in <module>
model.populate(model_file_name)
File "_dynet.pyx", line 1461, in _dynet.ParameterCollection.populate
File "_dynet.pyx", line 1516, in _dynet.ParameterCollection.populate_from_textfile
RuntimeError: Dimensions of lookup parameter /_0 lookup up from file ({100,400574}) do not match parameters to be populated ({100,410050})
I thought perhaps, for some reason, you were supposed to run a test first, since other issues I found similar to this mentioned that it can happen if the training and testing config aren't perfect matches.
$ python3 -m sesame.targetid --mode test --model_name
fn1.7-pretrained-targetid
[dynet] random seed: 3132663994
[dynet] allocating memory: 512MB
[dynet] memory allocation done.
ARGID_LR: 0.0005
DATA_DIRECTORY: data/
DEBUG_MODE: False
EMBEDDINGS_FILE: data/glove.6B.100d.txt
VERSION: 1.7
_____________________
COMMAND: /home/alan/git_projects/open-sesame/sesame/targetid.py --mode test --model_name fn1.7-pretrained-targetid
MODEL FOR TEST / PREDICTION: logs/fn1.7-pretrained-targetid/best-targetid-1.7-model
PARSING MODE: test
_____________________
Reading data/open_sesame_v1_data/fn1.7/fn1.7.fulltext.train.syntaxnet.conll ...
591032it [00:07, 80464.20it/s]
# examples in data/open_sesame_v1_data/fn1.7/fn1.7.fulltext.train.syntaxnet.conll : 19391 in 3413 sents
# examples with missing arguments : 526
Combined 19391 instances in data into 3413 instances.
Reading the lexical unit index file: data/fndata-1.7/luIndex.xml
# unique targets = 9421
# total targets = 13572
# targets with multiple LUs = 4151
# max LUs per target = 5
Reading pretrained embeddings from data/glove.6B.100d.txt ...
Reading data/open_sesame_v1_data/fn1.7/fn1.7.test.syntaxnet.conll ...
189185it [00:02, 74813.60it/s]
# examples in data/open_sesame_v1_data/fn1.7/fn1.7.test.syntaxnet.conll : 6714 in 1354 sents
# examples with missing arguments : 491
Combined 6714 instances in data into 1354 instances.
PARSER SETTINGS (see logs/fn1.7-pretrained-targetid/configuration.json)
_____________________
DEV_EVAL_EPOCH_FREQUENCY: 3
DROPOUT_RATE: 0.01
EVAL_AFTER_EVERY_EPOCHS: 100
HIDDEN_DIM: 100
LEMMA_DIM: 100
LSTM_DEPTH: 2
LSTM_DIM: 100
LSTM_INPUT_DIM: 100
NUM_EPOCHS: 100
PATIENCE: 25
POS_DIM: 100
PRETRAINED_EMBEDDING_DIM: 100
TOKEN_DIM: 100
TRAIN: data/neural/fn1.7/fn1.7.fulltext.train.syntaxnet.conll
UNK_PROB: 0.1
USE_DROPOUT: True
# Tokens = 410050
Unseen in dev/test = 2029
Unlearnt in dev/test = 402029
# POS tags = 45
Unseen in dev/test = 0
Unlearnt in dev/test = 1
# Lemmas = 9349
Unseen in dev/test = 1958
Unlearnt in dev/test = 1959
_____________________
Reading model from logs/fn1.7-pretrained-targetid/best-targetid-1.7-model ...
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/alan/git_projects/open-sesame/sesame/targetid.py", line 433, in <module>
model.populate(model_file_name)
File "_dynet.pyx", line 1461, in _dynet.ParameterCollection.populate
File "_dynet.pyx", line 1516, in _dynet.ParameterCollection.populate_from_textfile
RuntimeError: Dimensions of lookup parameter /_0 lookup up from file ({100,400574}) do not match parameters to be populated ({100,410050})
So I am at quite a loss now. Details of what I am running below. Note that I am using the current release of DyNet (2.1.2) because the suggested one in the README seems to be unavailable. This seems to be because Eigen is no longer downloadable from the location it used to be. Installing Eigen from scratch is well over my head (as shown by a cascade of bugs which I won't reproduce here), so I am hoping that I can get by with 2.1.2.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
$ python3 --version
Python 3.8.5
$ pip show nltk
Name: nltk
Version: 3.5
Summary: Natural Language Toolkit
Home-page: http://nltk.org/
Author: Steven Bird
Author-email: [email protected]
License: Apache License, Version 2.0
Location: /home/alan/.local/lib/python3.8/site-packages
Requires: click, tqdm, joblib, regex
Required-by:
$ pip show dynet
Name: dyNET
Version: 2.1.2
Summary: The Dynamic Neural Network Toolkit
Home-page: https://github.com/clab/dynet
Author: Graham Neubig
Author-email: [email protected]
License: Apache 2.0
Location: /home/alan/.local/lib/python3.8/site-packages
Requires: numpy, cython
Required-by:
Thank you,
Alan