我浏览了https://github.com/tensorflow/models/tree/master/syntaxnet并做了它所说的一切。
我跑了这个来测试:
bazel test --linkopt=-headerpad_max_install_names \
syntaxnet/... util/utf8/...
我只能使 6 次测试通过,6 次失败。
但是当我运行演示时,我得到了错误。
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
这是怎么回事?demo.sh 是否在与其放置位置不同的位置寻找那些 python 导入?