SyntaxNet : modified brain_parser_features yield segmentation fault
[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?
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:
- Make sure you have semi-colons for each group of features
- Make sure the embedding_dims and embedding_names parameters match the order and groups of features in #1
thank you :) i understand the order and what the group means