Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred when creating a pseudo label #22

Closed
Wang-pengfei opened this issue Dec 9, 2020 · 5 comments
Closed

An error occurred when creating a pseudo label #22

Wang-pengfei opened this issue Dec 9, 2020 · 5 comments

Comments

@Wang-pengfei
Copy link

==> Create pseudo labels for unlabeled target domain with self-paced policy
Computing jaccard distance...
Traceback (most recent call last):
File "examples/spcl_train_uda.py", line 341, in
main()
File "examples/spcl_train_uda.py", line 109, in main
main_worker(args)
File "examples/spcl_train_uda.py", line 175, in main_worker
rerank_dist = compute_jaccard_distance(target_features, k1=args.k1, k2=args.k2)
File "/home/amax/SpCL/spcl/utils/faiss_rerank.py", line 41, in compute_jaccard_distance
_, initial_rank = search_raw_array_pytorch(res, target_features, target_features, k1)
File "/home/amax/SpCL/spcl/utils/faiss_utils.py", line 82, in search_raw_array_pytorch
I_ptr = swig_ptr_from_LongTensor(I)
File "/home/amax/SpCL/spcl/utils/faiss_utils.py", line 15, in swig_ptr_from_LongTensor
return faiss.cast_integer_to_long_ptr(
AttributeError: module 'faiss' has no attribute 'cast_integer_to_long_ptr'

@Wang-pengfei
Copy link
Author

conda install faiss-gpu cudatoolkit=9.0 -c pytorch

I have solved this problem.

@Wang-pengfei
Copy link
Author

==> Create pseudo labels for unlabeled target domain with self-paced policy
Computing jaccard distance...
Traceback (most recent call last):
File "examples/spcl_train_uda.py", line 341, in
main()
File "examples/spcl_train_uda.py", line 109, in main
main_worker(args)
File "examples/spcl_train_uda.py", line 175, in main_worker
rerank_dist = compute_jaccard_distance(target_features, k1=args.k1, k2=args.k2)
File "/home/amax/SpCL/spcl/utils/faiss_rerank.py", line 41, in compute_jaccard_distance
_, initial_rank = search_raw_array_pytorch(res, target_features, target_features, k1)
File "/home/amax/SpCL/spcl/utils/faiss_utils.py", line 82, in search_raw_array_pytorch
I_ptr = swig_ptr_from_LongTensor(I)
File "/home/amax/SpCL/spcl/utils/faiss_utils.py", line 15, in swig_ptr_from_LongTensor
return faiss.cast_integer_to_long_ptr(
AttributeError: module 'faiss' has no attribute 'cast_integer_to_long_ptr'

我换了一台机器,这次cuda版本是10.1,仍然出现了这个错误。
使用conda install faiss-gpu cudatoolkit=10.1 -c pytorch 依然没有解决。

@yxgeee
Copy link
Owner

yxgeee commented Dec 13, 2020

听别人反映,应该是faiss的版本问题,你按照faiss 1.6.3试试

@Wang-pengfei
Copy link
Author

之前报错的时候我安装的就是faiss 1.6.3。我这边把cuda换成9.0就可以跑通了,不知道是不是faiss和cuda版本之间有什么不兼容。

@longma2020
Copy link

Following the guide of README, I met the same problem. After checking the code in https://github.com/facebookresearch/faiss/blob/master/contrib/torch_utils.py, my solution is replacing cast_integer_to_long_ptr by cast_integer_to_idx_t_ptr for the use of faiss 1.6.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants