我浏览了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导入?
发布于 2016-05-22 01:21:40
解决了。我遗漏了bazel安装中的一些步骤,特别是“获取bash完成”。我还以为那只是给jdk7用的。
发布于 2016-05-18 17:03:47
再次尝试使用bazel命令构建和测试SyntaxNet。我遇到了一个非常类似的错误,bazel在我的机器上找不到python目录。在几次尝试定位python目录之后,bazel用一次失败测试(根据bazel,这是一个本地主机错误)完成了SyntaxNet的构建和测试,demo.sh工作得很好。
我再次尝试构建和测试Syntaxnet,好消息是这次它通过了12个测试。
INFO: Elapsed time: 88.935s, Critical Path: 31.63s
//syntaxnet:arc_standard_transitions_test (cached) PASSED in 3.5s
//syntaxnet:beam_reader_ops_test (cached) PASSED in 20.6s
//syntaxnet:graph_builder_test (cached) PASSED in 21.4s
//syntaxnet:lexicon_builder_test (cached) PASSED in 8.7s
//syntaxnet:parser_features_test (cached) PASSED in 0.7s
//syntaxnet:parser_trainer_test (cached) PASSED in 36.4s
//syntaxnet:reader_ops_test (cached) PASSED in 6.0s
//syntaxnet:sentence_features_test (cached) PASSED in 1.6s
//syntaxnet:tagger_transitions_test (cached) PASSED in 1.6s
//syntaxnet:text_formats_test (cached) PASSED in 8.7s
//util/utf8:unicodetext_unittest (cached) PASSED in 5.6s
//syntaxnet:shared_store_test PASSED in 6.0s
Executed 1 out of 12 tests: 12 tests pass.bazel的这个额外的提醒可能会有所帮助:
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.希望这能有所帮助。
https://stackoverflow.com/questions/37240053
复制相似问题