question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'faiss' has no attribute 'cast_integer_to_long_ptr'

See original GitHub issue

When i run the train_net.py in --eval-only mode with rerank enable, i got the error: [05/28 16:15:42 fastreid.evaluation.evaluator]: Start inference on 19889 images [05/28 16:15:50 fastreid.evaluation.evaluator]: Inference done 11/156. 0.5326 s / batch. ETA=0:01:21 [05/28 16:16:20 fastreid.evaluation.evaluator]: Inference done 64/156. 0.5372 s / batch. ETA=0:00:52 [05/28 16:16:50 fastreid.evaluation.evaluator]: Inference done 116/156. 0.5423 s / batch. ETA=0:00:22 [05/28 16:17:13 fastreid.evaluation.evaluator]: Total inference time: 0:01:26.502893 (0.572867 s / batch per device, on 1 devices) [05/28 16:17:13 fastreid.evaluation.evaluator]: Total inference pure compute time: 0:01:22 (0.544687 s / batch per device, on 1 devices) [05/28 16:17:17 fastreid.evaluation.reid_evaluation]: Test with rerank setting Traceback (most recent call last): File "tools/train_net.py", line 57, in <module> args=(args,), File "./fastreid/engine/launch.py", line 71, in launch main_func(*args) File "tools/train_net.py", line 39, in main res = DefaultTrainer.test(cfg, model) File "./fastreid/engine/defaults.py", line 454, in test results_i = inference_on_dataset(model, data_loader, evaluator, flip_test=cfg.TEST.FLIP.ENABLED) File "./fastreid/evaluation/evaluator.py", line 156, in inference_on_dataset results = evaluator.evaluate() File "./fastreid/evaluation/reid_evaluation.py", line 102, in evaluate rerank_dist = build_dist(query_features, gallery_features, metric="jaccard", k1=k1, k2=k2) File "/home/ccf/anaconda3/envs/fastreid/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context return func(*args, **kwargs) File "./fastreid/utils/compute_dist.py", line 53, in build_dist dist = compute_jaccard_distance(feat, k1=kwargs["k1"], k2=kwargs["k2"], search_option=0) File "/home/ccf/anaconda3/envs/fastreid/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context return func(*args, **kwargs) File "./fastreid/utils/compute_dist.py", line 78, in compute_jaccard_distance _, initial_rank = search_raw_array_pytorch(res, features, features, k1) File "./fastreid/utils/faiss_utils.py", line 87, in search_raw_array_pytorch I_ptr = swig_ptr_from_LongTensor(I) File "./fastreid/utils/faiss_utils.py", line 19, in swig_ptr_from_LongTensor return faiss.cast_integer_to_long_ptr( AttributeError: module 'faiss' has no attribute 'cast_integer_to_long_ptr'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AlphaPlusTTcommented, Jun 1, 2021

yes, faiss<=1.6.4 is fine

0reactions
gallardorafaelcommented, Dec 10, 2021

Just to confirm: faiss<=1.6.4 solves the problem.

The problem is that the ‘cast_integer_to_long_ptr’ disappeared after 1.6.4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module 'faiss' has no attribute 'cast_integer_to_long_ptr' #2031
When I install faiss by running : conda install -c conda-forge faiss-gpu, it succeed. But when I run my code, it occured :...
Read more >
module 'faiss._swigfaiss' has no attribute 'delete_floatvector'
AttributeError : module 'faiss.swigfaiss' has no attribute 'deleteFloatVector'. The code I try to run is: import argparse import os import pickle import time ......
Read more >
module 'faiss' has no attribute 'cast_integer_to_long_ptr' - 博客园
本来安装的faiss-gpu版本是1.7.x 报错:module 'faiss' has no attribute 'cast_integer_to_long_ptr'
Read more >
I am getting the below exception when trying to use Faiss 1.5.3
I am getting the below exception when trying to use Faiss 1.5.3. AttributeError: module 'faiss' has no attribute 'IndexFlatL2'. Below is my code...
Read more >
module 'faiss' has no attribute 'StandardGpuResources'
前言faiss真的恶心…升级版本废弃了以前的名字和函数,版本不一致很多报错,然后这个包又有cpu和gpu版本…两个版本相同版本号还有diff,要命…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found