gpt4 book ai didi

python - 为什么 SyntaxNet demo.sh 找不到正确的导入?

转载 作者:太空狗 更新时间:2023-10-30 02:42:15 25 4
gpt4 key购买 nike

我经历了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 导入?

最佳答案

已解决。我遗漏了 bazel 安装中的一些步骤,特别是“获取 bash 完成”。我以为那只是为了jdk7.

关于python - 为什么 SyntaxNet demo.sh 找不到正确的导入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37240053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com