美文网首页
faiss升级numpy版本惹的祸

faiss升级numpy版本惹的祸

作者: 城中山谷 | 来源:发表于2020-10-08 09:04 被阅读0次

    最近在进行Facebook的基于faiss语义召回用于电商搜索的召回开发工作时候,基于tensorflow在训练dssm模型的过程中,模型的代码在图的run过程中,出现了莫名其妙的bug,信息如下:

    TypeErrorTraceback (most recent call last)TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'The above exception was the direct cause of the following exception:ValueErrorTraceback (most recent call last)

    ....

    ValueError: setting an array element with a sequence.

    困扰很久,原因是:安装faiss时候把numpy版本升级为了1.19.1原来的1.15.1被替换了;但是把版本回退到1.15.1时候faiss计算向量相似性时候又出错,所以只能分开两个虚拟环境分别进行两个阶段的工作,具体原因还未查看源码。

    参考资料:

    https://www.liangzl.com/get-article-detail-202136.html

    https://stackoverflow.com/questions/63097829/debugging-numpy-visibledeprecationwarning-ndarray-from-ragged-nested-sequences

    相关文章

      网友评论

          本文标题:faiss升级numpy版本惹的祸

          本文链接:https://www.haomeiwen.com/subject/sjycpktx.html