python - RuntimeError:python 注册表中缺少的图形操作({'SentencepieceEncodeSparse'})也没有出现在 c++ 注册表中
问题描述
我正在尝试sentecepiece
在 Windows 系统中使用,同时实现tensorflow中描述的通用句子编码器。
但我得到以下错误:
RuntimeError:python 注册表中缺少的图形操作 ({'SentencepieceEncodeSparse'}) 在 c++ 注册表中也没有。
我知道现在已经支持这个库:
我也尝试sentencepiece
使用
pip install --user sentencepiece
许多版本进行安装。我可以 import ,但C++ 注册表中也没有sentencepiece
出现错误
。RuntimeError: Graph ops missing from the python registry ({'SentencepieceEncodeSparse'})
我也试过 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 - 如何对具有多特征的时间序列数据进行切片以获得连续图包含[训练+测试+预测]?
- r - 将单行中的数据放入多行
- php - YITH WooCommerce 愿望清单:帮我在侧边栏小部件和愿望清单管理区域中显示第一个项目/产品缩略图?
- ios - 在 Swift 中重试 firebase 令牌
- powershell - 替换连接字符串中的数据源
- javascript - 为什么异步等待代码中的捕获不触发?
- javascript - Dygraphs:系列的一部分到单独的图例中
- java - Eclipse Spring Boot - 在 HibernateJpaAutoConfiguration 和 CacheAutoConfiguration 之间检测到自动配置周期
- string - 在抛出“std::logic_error”字符串比较的实例后调用终止
- ruby-on-rails - 如何更新rails rspec nasted let属性