【问题标题】:Google Colaboratory NotFoundError: /usr/local/lib/python3.7/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.soGoogle Colaboratory NotFoundError:/usr/local/lib/python3.7/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.so
【发布时间】:2021-08-11 09:15:59
【问题描述】:

导入 Top2vec(在 colab 笔记本中)时遇到问题。 重现它:

pip install top2vec[sentence_encoders]

重启运行时加载新模块,然后

from top2vec import Top2Vec

它显示了这个错误:

---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
<ipython-input-8-9a81163f0da9> in <module>()
----> 1 from top2vec import Top2Vec

5 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename)
     55     RuntimeError: when unable to load the library or get the python wrappers.
     56   """
---> 57   lib_handle = py_tf.TF_LoadLibrary(library_filename)
     58   try:
     59     wrappers = _pywrap_python_op_gen.GetPythonWrappers(

NotFoundError: /usr/local/lib/python3.7/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.so: undefined symbol: _ZN10tensorflow15OpKernelContext15allocate_outputEN4absl14lts_2020_09_2311string_viewERKNS_11TensorShapeEPPNS_6TensorE

我找到了说明您应该安装的解决方案 pip install -U tensorflow==2.3.0 但是这个版本不兼容top2vec

【问题讨论】:

    标签: python tensorflow pip google-colaboratory


    【解决方案1】:

    我认为这可能是由于 Tensorflow 在使用时不兼容

    !pip install top2vec[sentence_encoders]
    

    我通过首先安装 Top2Vec 所需版本的 TensorFlow 和 numpy 解决了这个问题:

    !pip install tensorflow==2.5.0
    !pip install numpy
    

    然后安装 Top2Vec 和预训练的通用句子编码器:

    !pip install top2vec
    !pip install top2vec[sentence_encoders]
    

    【讨论】:

      猜你喜欢
      • 2021-10-21
      • 2023-02-02
      • 1970-01-01
      • 2021-12-07
      • 2022-11-10
      • 2022-12-16
      • 1970-01-01
      • 2021-01-06
      • 2021-07-18
      相关资源
      最近更新 更多