无法导入tf_sentencepiece-原因:找不到图片

时间:2019-07-17 10:18:50

标签: python tensorflow

尝试导入库tf_sentencepiece,以使用以下link。使用macOS,已经通过pip安装了库并得到了:

pip install tf_sentencepiece
Requirement already satisfied: tf_sentencepiece in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.1.82)

导入库时,我收到错误消息:

NotFoundError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tf_sentencepiece/_sentencepiece_processor_ops.so.1.13.1, 6): Library not loaded: @rpath/libtensorflow_framework.so
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tf_sentencepiece/_sentencepiece_processor_ops.so.1.13.1
  Reason: image not found.

我还会收到警告警报:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tf_sentencepiece/sentencepiece_processor_ops.py:38: UserWarning: No so file is found for [1.14.0] from [1.12.0, 1.11.0, 1.8.0, 1.7.0, 1.10.0, 1.9.0, 1.13.1]
  ', '.join(versions)))
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tf_sentencepiece/sentencepiece_processor_ops.py:39: UserWarning: use the latest version 1.13.1
  warnings.warn('use the latest version %s' % (latest))

关于可能是什么问题的任何想法?

1 个答案:

答案 0 :(得分:0)

将tensorflow降级到1.13.1版可解决此问题。由于库tf_sentencepiece支持tensorflow到版本1.13.1。