尝试导入库 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))
知道可能出现什么问题吗?
最佳答案
将tensorflow降级到版本1.13.1可以解决该问题。由于库 tf_sentencepiece 支持 TensorFlow 至版本 1.13.1 。
关于python - 无法导入 tf 句子 - 原因 : image not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57073609/