numpy中int和numpy.int64格式不同的问题
2019-11-20 本文已影响0人
afwer3
之前遇到了如下的错误问题:
TypeError: in method 'ReconstructFromNeighbors_get_neighbor_table', argument 2 of type 'faiss::ReconstructFromNeighbors::storage_idx_t'
其中storage_idx_t为int类型,肉眼看没有问题,实参貌似也为int类型,但一直在报错。无奈使用type()查看了一下格式发现了蹊跷,实参并不是<class 'int'>类型,而是<class 'numpy.int64'>类型,之后使用int()强转后解决了这个问题。
https://blog.csdn.net/weixin_33769125/article/details/91878728