una-dinosauria / Rayuela.jl

Code for my PhD thesis. Library of quantization-based methods for fast similarity search in high dimensions. Presented at ECCV 18.
MIT License
63 stars 4 forks source link

MethodError: no method matching repick_unused_centers #45

Closed jingtaozhan closed 3 years ago

jingtaozhan commented 3 years ago

I follow the instructions and run the first demo, but I got an error during training RVQ:

ERROR: LoadError: MethodError: no method matching repick_unused_centers(::Array{Float32,2}, ::Array{Float32,1}, ::Array{Float32,2}, ::Array{Int64,1})
Closest candidates are:
  repick_unused_centers(::AbstractArray{#s108,2} where #s108<:Real, ::Array{#s107,1} where #s107<:Real, ::AbstractArray{#s106,2} where #s106<:AbstractFloat, ::Array{Int64,1}, ::Distances.SemiMetric) at /home/zjt/.julia/packages/Clustering/tt9vc/src/kmeans.jl:377
Stacktrace:
 [1] quantize_rvq(::Array{Float32,2}, ::Array{Array{Float32,2},1}, ::Bool) at /home/zjt/.julia/dev/Rayuela/src/RVQ.jl:51
 [2] experiment_rvq(::Array{Float32,2}, ::Array{Float32,2}, ::Array{Float32,2}, ::Array{UInt32,1}, ::Int64, ::Int64, ::Int64, ::Int64, ::Bool) at /home/zjt/.julia/dev/Rayuela/src/RVQ.jl:142
 [3] run_demos(::String, ::Int64, ::Int64, ::Int64, ::Int64) at /home/zjt/.julia/dev/Rayuela/demos/demos_train_query_base.jl:41
 [4] top-level scope at /home/zjt/.julia/dev/Rayuela/demos/demos_train_query_base.jl:171 [inlined]
 [5] top-level scope at ./none:0
 [6] include at ./boot.jl:317 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1044
 [8] include(::Module, ::String) at ./sysimg.jl:29
 [9] include(::String) at ./client.jl:392
 [10] top-level scope at none:0
in expression starting at /home/zjt/.julia/dev/Rayuela/demos/demos_train_query_base.jl:170
una-dinosauria commented 3 years ago

No worries! I think this is because the method repick_unused_centers is out of date, and now receives a distance Distances.SqEuclidean as the last parameter. Lemme give it a try!

Btw -- what julia version are you using? I am putting together a Docker image to make sure these reproducibility issues don't happen again.

jingtaozhan commented 3 years ago

It's very nice of you! The version is 1.0.4. I also tried with version 1.1 but no luck.

una-dinosauria commented 3 years ago

https://github.com/una-dinosauria/Rayuela.jl/pull/48 might close this. Could you please give it a try? If so, I'll merge tomorrow morning.

This and the previous fix should also kind of show the pattern to solve other issues.

https://github.com/una-dinosauria/Rayuela.jl/pull/47 has the docker image I'm using. I think I see issue #46 there as well, which is great because that means we can reproduce the issues!

Sorry about this, it's only recently that I've become more comfortable with docker.

jingtaozhan commented 3 years ago

Thank you, It works! After I additionally passed Distances.SqEuclidean() to the function. RVQ and ERVQ are OK now!