models icon indicating copy to clipboard operation
models copied to clipboard

File "/usr/lib/python2.7/posixpath.py", line 77, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith'

Open giovanniMonte opened this issue 10 years ago • 3 comments

I am trying to train the SyntaxNet POS Tagger using the UD_Italian from Universal Dependencies. When i run bazel-bin/syntaxnet/parser_trainer --task_context=syntaxnet/context.pbtxt --arg_prefix=brain_pos
--compute_lexicon
--graph_builder=greedy
--training_corpus=training-corpus
--tuning_corpus=tuning-corpus --output_path=models
--batch_size=32
--decay_steps=3600 --hidden_layer_sizes=128 --learning_rate=0.08 --momentum=0.9 --seed=0 --params=128-0.08-3600-0.9-0

I've got:

Traceback (most recent call last): File "/root/models/syntaxnet/bazel-bin/syntaxnet/parser_trainer.runfiles/syntaxnet/parser_trainer.py", line 303, in tf.app.run() File "/root/models/syntaxnet/bazel-bin/syntaxnet/parser_trainer.runfiles/external/tf/tensorflow/python/platform/app.py", line 30, in run sys.exit(main(sys.argv)) File "/root/models/syntaxnet/bazel-bin/syntaxnet/parser_trainer.runfiles/syntaxnet/parser_trainer.py", line 259, in main if not gfile.IsDirectory(OutputPath('')): File "/root/models/syntaxnet/bazel-bin/syntaxnet/parser_trainer.runfiles/syntaxnet/parser_trainer.py", line 92, in OutputPath return os.path.join(FLAGS.output_path, StageName(), FLAGS.params, path) File "/root/models/syntaxnet/bazel-bin/syntaxnet/parser_trainer.runfiles/syntaxnet/parser_trainer.py", line 88, in StageName return os.path.join(FLAGS.arg_prefix, FLAGS.graph_builder) File "/usr/lib/python2.7/posixpath.py", line 77, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith' root@mypc:~/models/syntaxnet# --task_context=syntaxnet/context.pbtxt -bash: --task_context=syntaxnet/context.pbtxt: No such file or directory root@mypc:~/models/syntaxnet# --arg_prefix=brain_pos --arg_prefix=brain_pos: command not found root@mypc:~/models/syntaxnet# --compute_lexicon --compute_lexicon: command not found root@mypc:~/models/syntaxnet# --graph_builder=greedy --graph_builder=greedy: command not found root@mypc:~/models/syntaxnet# --training_corpus=training-corpus --training_corpus=training-corpus: command not found root@mypc:~/models/syntaxnet# --tuning_corpus=tuning-corpus --tuning_corpus=tuning-corpus: command not found root@mypc:~/models/syntaxnet# --output_path=models --output_path=models: command not found root@mypc:~/models/syntaxnet# --batch_size=32 --batch_size=32: command not found root@mypc:~/models/syntaxnet# --decay_steps=3600 --decay_steps=3600: command not found root@mypc:~/models/syntaxnet# --hidden_layer_sizes=128 --hidden_layer_sizes=128: command not found root@mypc:~/models/syntaxnet# --learning_rate=0.08 --learning_rate=0.08: command not found root@mypc:~/models/syntaxnet# --momentum=0.9 --momentum=0.9: command not found root@mypc:~/models/syntaxnet# --seed=0 --seed=0: command not found root@mypc:~/models/syntaxnet# --params=128-0.08-3600-0.9-0

i try to run only bazel-bin/syntaxnet/parser_trainer and the error is the same. what I am missing? Thanks a lot.

giovanniMonte avatar May 18 '16 13:05 giovanniMonte

It looks like that command is being split across your shell and interpreted as multiple commands:

e.g.

root@mypc:~/models/syntaxnet# --arg_prefix=brain_pos --arg_prefix=brain_pos: command not found

Make sure you use "" to break newlines that should be continued into a single line.

Best, David

djweiss avatar May 18 '16 14:05 djweiss

thanks, now i use '' to break new lines but i've got a new error

root@mypc:~/models/syntaxnet# bazel-bin/syntaxnet/parser_trainer \

--task_context=syntaxnet/context.pbtxt
--arg_prefix=brain_pos \ # read from POS configuration F syntaxnet/term_frequency_map.cc:62] Check failed: ::tensorflow::Status::OK() == (tensorflow::Env::Default()->NewRandomAccessFile(filename, &file)) (OK vs. Not found: brain_pos/greedy/0/label-map) root@mypc:~/models/syntaxnet# --compute_lexicon \ # required for first stage of pipeline --compute_lexicon: command not found root@mypc:~/models/syntaxnet# --graph_builder=greedy \ # no beam search --graph_builder=greedy: command not found root@mypc:~/models/syntaxnet# --training_corpus=training-corpus \ # names of training/tuning set --training_corpus=training-corpus: command not found root@mypc:~/models/syntaxnet# --tuning_corpus=tuning-corpus
--output_path=models \ # where to save new resources --tuning_corpus=tuning-corpus: command not found root@mypc:~/models/syntaxnet# --batch_size=32 \ # Hyper-parameters --batch_size=32: command not found root@mypc:~/models/syntaxnet# --decay_steps=3600
--hidden_layer_sizes=128
--learning_rate=0.08
--momentum=0.9
--seed=0
--params=128-0.08-3600-0.9-0 # name for these parameters --decay_steps=3600: command not found

Thanks a lot.

giovanniMonte avatar May 18 '16 14:05 giovanniMonte

The command is still being broken up -- please make sure you are running a single well formed command line and from the appropriate directory.

Thank you for your interest, but unfortunately your questions are beyond the scope of support we can provide here.

djweiss avatar May 18 '16 15:05 djweiss