Closed xiaoxiong74 closed 4 years ago
@yl-1993 感谢你的回复,我后面直接尝试使用faiss_gpu的内积暴力搜索,结果是准确的。
@yl-1993 感谢你的回复,我后面直接尝试使用faiss_gpu的内积暴力搜索,结果是准确的。
请问你用的faiss-gpu内积暴力搜索是哪个方法?在作者的knn内只看到了knn_brute_force。
@yl-1993 感谢你的回复,我后面直接尝试使用faiss_gpu的内积暴力搜索,结果是准确的。
请问你用的faiss-gpu内积暴力搜索是哪个方法?在作者的knn内只看到了knn_brute_force。
@zhaoxin111 自己调用faiss的gpu相关方法即可,如GpuIndexFlatIP(res, dim)。
你好! 我在跑模型gcn-v时,当knn_method = 'faiss'时,运行结果正确。 但是我在跑gcn-v构建knn时,设置了knn_method = 'faiss_gpu',报如下错误:
Traceback (most recent call last): File "vegcn/main.py", line 104, in
main()
File "vegcn/main.py", line 100, in main
handler(model, cfg, logger)
File "/home/deeplearn/project/test/learn-to-cluster/vegcn/test_gcn_v.py", line 51, in test_gcn_v
dataset = build_dataset(cfg.model['type'], cfg.test_data)
File "/home/deeplearn/project/test/learn-to-cluster/vegcn/datasets/init.py", line 13, in build_dataset
return factorymodel_type
File "/home/deeplearn/project/test/learn-to-cluster/vegcn/datasets/gcn_v_dataset.py", line 52, in init
cfg.knn)
File "/home/deeplearn/project/test/learn-to-cluster/utils/knn.py", line 210, in build_knns
num_process=num_process)
File "/home/deeplearn/project/test/learn-to-cluster/utils/knn.py", line 398, in init
verbose=False)
File "/home/deeplearn/project/test/learn-to-cluster/utils/faiss_search.py", line 110, in faiss_search_knn
verbose=verbose)
File "/home/deeplearn/project/test/learn-to-cluster/utils/faiss_search.py", line 20, in precise_dist
verbose=verbose)
File "/home/deeplearn/project/test/learn-to-cluster/utils/faiss_search.py", line 36, in precise_dist_share_mem
num_per_proc = int(num / num_process) + 1
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'
然后我更改了 num_preocess,并设置为1 、或者直接通过multiprocessing.cpu_count()设置、或者设置为其他值,上述错误消失,但得到的结果特别差。 请教下,这可能是由于什么原因导致的呢?