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 while testing with the default config file #60

Open
OXPHOS opened this issue Oct 31, 2019 · 1 comment
Open

Error while testing with the default config file #60

OXPHOS opened this issue Oct 31, 2019 · 1 comment

Comments

@OXPHOS
Copy link

OXPHOS commented Oct 31, 2019

I ran into several errors when I tried to run the testing script with the provided instructions:

python ${workspace}/BiMPM/src/SentenceMatchDecoder.py --in_path ${your_path_to}/dev.tsv --word_vec_path ${your_path_to}/wordvec.txt --out_path ${your_path_to}/result.json --model_prefix ${model_dir}/SentenceMatch.${suffix}

And most of them were caused by missing values of the params in the automactiaclly-generated ${model_prefix}.config.json file.

For example:
AttributeError: 'Bunch' object has no attribute 'isLower'

  • Because isLower is not defined in config.json

NameError: name 'char_vocab' is not defined

  • with_char is defaulted False, in which case char_vocab is not defined.

AttributeError: 'Bunch' object has no attribute 'use_cudnn'

  • use_cudnn is missing in config.json. And according to TLfERLS, it needs to be set false.

And so on.
The solution I found was to replace the Line 25 in SentenceMatchDecoder.pyfrom
options = namespace_utils.load_namespace(args.model_prefix + ".config.json")
to
options = namespace_utils.load_namespace('/Users/zora/Github/BiMPM/configs/quora.sample.config')
, thus the script could use the config file supplied for training. I am not sure whether this is the correct move, but it worked.

P.S. My config.json generated automatically by SentenceMatchTrainer.py:

{
    "aggregation_layer_num": 1,
    "aggregation_lstm_dim": 100,
    "batch_size": 60,
    "char_emb_dim": 20,
    "char_lstm_dim": 100,
    "config_path": null,
    "context_layer_num": 1,
    "context_lstm_dim": 100,
    "dev_path": null,
    "dropout_rate": 0.1,
    "fix_word_vec": false,
    "highway_layer_num": 1,
    "in_format": "tsv",
    "lambda_l2": 0.0,
    "learning_rate": 0.001,
    "max_char_per_word": 10,
    "max_epochs": 10,
    "max_sent_length": 100,
    "model_dir": "/***/BiMPM/quora/logs/",
    "optimize_type": "adam",
    "suffix": "normal",
    "test_path": null,
    "train_path": null,
    "with_aggregation_highway": false,
    "with_attentive_match": false,
    "with_char": false,
    "with_full_match": false,
    "with_highway": false,
    "with_match_highway": false,
    "with_max_attentive_match": false,
    "with_maxpool_match": false,
    "word_vec_path": "/***/BiMPM/quora/data/wordvec.txt"
}
@pellfun
Copy link

pellfun commented Dec 10, 2019

I tried what you said but I still can't find the ".label_vocab" file

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

2 participants