I went through https://github.com/tensorflow/models/tree/master/syntaxnet and did everything it says.
I ran this to test:
bazel test --linkopt=-headerpad_max_install_names \
syntaxnet/... util/utf8/...
I could only make 6 test pass and 6 fails.
But when I run the demo, I am getting error.
User:syntaxnet hk$ echo "Parsey McParseface is my favorite parser" | syntaxnet/demo.sh
Traceback (most recent call last):
File "/git/models/syntaxnet/bazel-bin/syntaxnet/conll2tree.runfiles/syntaxnet/conll2tree.py", line 20, in <module>
import tensorflow as tf
File "/git/models/syntaxnet/bazel-bin/syntaxnet/conll2tree.runfiles/external/tf/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/git/models/syntaxnet/bazel-bin/syntaxnet/conll2tree.runfiles/external/tf/tensorflow/python/__init__.py", line 45, in <module>
from tensorflow.python import pywrap_tensorflow
ImportError: cannot import name pywrap_tensorflow
Traceback (most recent call last):
Traceback (most recent call last):
File "/git/models/syntaxnet/bazel-bin/syntaxnet/parser_eval.runfiles/syntaxnet/parser_eval.py", line 23, in <module>
File "/git/models/syntaxnet/bazel-bin/syntaxnet/parser_eval.runfiles/syntaxnet/parser_eval.py", line 23, in <module>
import tensorflow as tf
File "/git/models/syntaxnet/bazel-bin/syntaxnet/parser_eval.runfiles/external/tf/tensorflow/__init__.py", line 23, in <module>
import tensorflow as tf
File "/git/models/syntaxnet/bazel-bin/syntaxnet/parser_eval.runfiles/external/tf/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/git/models/syntaxnet/bazel-bin/syntaxnet/parser_eval.runfiles/external/tf/tensorflow/python/__init__.py", line 45, in <module>
from tensorflow.python import *
File "/git/models/syntaxnet/bazel-bin/syntaxnet/parser_eval.runfiles/external/tf/tensorflow/python/__init__.py", line 45, in <module>
from tensorflow.python import pywrap_tensorflow
ImportError: from tensorflow.python import pywrap_tensorflow
cannot import name pywrap_tensorflow
ImportError: cannot import name pywrap_tensorflow
what's going on? Is the demo.sh looking for those python imports in different place than where it is placed?
Try building and testing SyntaxNet once again using the bazel command. I encountered a quite similar error to this where bazel cannot find the python dir on my machine. After several tries of locating the python dir, bazel finished building and testing SyntaxNet with 1 fail test (a localhost error according to bazel), demo.sh works fine.
I tried building and testing Syntaxnet once again and good thing that this time it passed the 12 tests.
And there's this additional reminder from bazel that might help:
Hope this helps.