gpt4 book ai didi

python - 运行时错误 : Graph ops missing from the python registry ( {'SentencepieceEncodeSparse' }) are also absent from the c++ registry

转载 作者:可可西里 更新时间:2023-11-01 10:41:05 28 4
gpt4 key购买 nike

我正在尝试在 Windows 系统中使用 sentecepiece,同时将通用句子编码器实现为 described在 tensorflow 中。

但我遇到以下错误:

RuntimeError: Graph ops missing from the python registry ({'SentencepieceEncodeSparse'}) are also absent from the c++ registry.

我知道this现在已经支持库:

我尝试安装 sentencepiece 使用pip install --user sentencepiece也有很多版本。我可以导入 sentencepiece,但出现错误RuntimeError:Python 注册表中缺少图形操作 ({'SentencepieceEncodeSparse'}) C++ 注册表中也不存在。

我也试过 conda install tf_sentencepiece,但它会抛出一个错误:anaconda3\lib\site-packages\tf_sentencepiece\_sentencepiece_processor_ops。因此,它要么未设计为在 Windows 上运行,要么包含错误。


NotFoundError                             Traceback (most recent call last)
<ipython-input-62-956b40af1330> in <module>
----> 1 import tf_sentencepiece

~\AppData\Local\Continuum\anaconda3\lib\site-packages\tf_sentencepiece\__init__.py in <module>
3 from __future__ import print_function
4
----> 5 from tf_sentencepiece.sentencepiece_processor_ops import *

~\AppData\Local\Continuum\anaconda3\lib\site-packages\tf_sentencepiece\sentencepiece_processor_ops.py in <module>
25
26 _gen_sentencepiece_processor_op = tf.load_op_library(
---> 27 os.path.join(os.path.dirname(__file__), '_sentencepiece_processor_ops.so'))
28
29

~\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\framework\load_library.py in load_op_library(library_filename)
59 RuntimeError: when unable to load the library or get the python wrappers.
60 """
---> 61 lib_handle = py_tf.TF_LoadLibrary(library_filename)
62
63 op_list_str = py_tf.TF_GetOpList(lib_handle)

NotFoundError: C:\Users\AUSER\AppData\Local\Continuum\anaconda3\lib\site-packages\tf_sentencepiece\_sentencepiece_processor_ops.so not found

最佳答案

您必须将 TensorFlow 版本降级到 1.13.1。你可以在谷歌的 github 页面上看到: https://github.com/google/sentencepiece/tree/master/tensorflow/tf_sentencepiece

(看描述)

关于python - 运行时错误 : Graph ops missing from the python registry ( {'SentencepieceEncodeSparse' }) are also absent from the c++ registry,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56748184/

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