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

SyntaxNet : modified brain_parser_features yield segmentation fault #159

Closed
dsindex opened this issue May 27, 2016 · 2 comments
Closed

SyntaxNet : modified brain_parser_features yield segmentation fault #159

dsindex opened this issue May 27, 2016 · 2 comments

Comments

@dsindex
Copy link

dsindex commented May 27, 2016

[before]
Parameter {
name: 'brain_parser_features'
value: 'input.word input(1).word input(2).word input(3).word stack.word stack(1).word stack(2).word stack(3).word stack.child(1).word stack.child(1).sibling(-1).word stack.child(-1).word stack.child(-1).sibling(1).word stack(1).child(1).word stack(1).child(1).sibling(-1).word stack(1).child(-1).word stack(1).child(-1).sibling(1).word stack.child(2).word stack.child(-2).word stack(1).child(2).word stack(1).child(-2).word;input.tag input(1).tag input(2).tag input(3).tag stack.tag stack(1).tag stack(2).tag stack(3).tag stack.child(1).tag stack.child(1).sibling(-1).tag stack.child(-1).tag stack.child(-1).sibling(1).tag stack(1).child(1).tag stack(1).child(1).sibling(-1).tag stack(1).child(-1).tag stack(1).child(-1).sibling(1).tag stack.child(2).tag stack.child(-2).tag stack(1).child(2).tag stack(1).child(-2).tag;stack.child(1).label stack.child(1).sibling(-1).label stack.child(-1).label stack.child(-1).sibling(1).label stack(1).child(1).label stack(1).child(1).sibling(-1).label stack(1).child(-1).label stack(1).child(-1).sibling(1).label stack.child(2).label stack.child(-2).label stack(1).child(2).label stack(1).child(-2).label'
}
[after]
Parameter {
name: 'brain_parser_features'
value: 'input.tag input(1).tag input(2).tag input(3).tag stack.tag stack(1).tag stack(2).tag stack(3).tag input.word input(1).word input(2).word input(3).word stack.word stack(1).word stack(2).word stack(3).word '
}

....

  • /root/syntaxnet/models/syntaxnet/bazel-bin/syntaxnet/parser_trainer --arg_prefix=brain_parser --batch_size=256 --compute_lexicon --decay_steps=4400 --graph_builder=greedy --hidden_layer_sizes=512,512 --learning_rate=0.08 --momentum=0.85 --beam_size=1 --output_path=/root/syntaxnet/models/syntaxnet/work/sejong/tmp_p/syntaxnet-output --task_context=/root/syntaxnet/models/syntaxnet/work/sejong/tmp_p/syntaxnet-output/context --projectivize_training_set --training_corpus=tagged-training-corpus --tuning_corpus=tagged-tuning-corpus --params=512,512-0.08-4400-0.85 --num_epochs=3 --report_every=100 --checkpoint_every=1000 --logtostderr
    ...
    ./train_sejong.sh: line 129: 2808 segmentation fault ${BINDIR}/parser_trainer --arg_prefix=brain_parser --batch_size=${BATCH_SIZE} --compute_lexicon --decay_steps=4400 --graph_builder=greedy --hidden_layer_sizes=${HIDDEN_LAYER_SIZES} --learning_rate=0.08 --momentum=0.85 --beam_size=1 --output_path=${TMP_DIR} --task_context=${TMP_DIR}/context --projectivize_training_set --training_corpus=tagged-training-corpus --tuning_corpus=tagged-tuning-corpus --params=${LP_PARAMS} --num_epochs=3 --report_every=100 --checkpoint_every=1000 --logtostderr

is there any rules for constructing features?

@djweiss
Copy link

djweiss commented May 27, 2016

It's hard to see, but in the original spec there's a semi-colon to distinguish the features for POS tags from words, tags, and labels. The feature spec must match the rest of the arguments:

Parameter {
name: "brain_parser_embedding_dims"
value: "32;32;64"
}
Parameter {
name: "brain_parser_embedding_names"
value: "labels;tags;words"
}

Here you see there are three feature groups, and the order is important. Otherwise the model will get feature values that don't correspond to the embedding matrix size, and you get segfaults.

So the solution is:

  1. Make sure you have semi-colons for each group of features
  2. Make sure the embedding_dims and embedding_names parameters match the order and groups of features in initial commit, simple, separated models #1

@djweiss djweiss closed this as completed May 27, 2016
@dsindex
Copy link
Author

dsindex commented May 27, 2016

thank you :) i understand the order and
what the group means

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