metric-learning-divide-and-conquer
metric-learning-divide-and-conquer copied to clipboard
correction for the code
Hi,
Thanks for the code.
Lately, I worked with the code and found out that there are two slights errors in the code, my observations are for python version 3.7.
-
In function lib/data/loader/util.py at Line 54, batch_size =-1 should be batch_size =-1.
-
function lib/data/loader/util.py at Line 94, yield b, dls[i].dataset should be yield b, dls[i]._dataset.
These may be tying error or just because of the different python versions, but the code worked for me after fixing them.
I fixed the errors in a branch here
https://github.com/theRealSuperMario/metric-learning-divide-and-conquer/tree/pytorch14
I also added which pytorch
version and Faiss
version have to work together to get it going. It turns out that the Faiss
interface has changed since the release which throws an error when running the code. The error is rooted here
https://github.com/CompVis/metric-learning-divide-and-conquer/blob/1766c2cffe1075692657898d2086af4bc9d92929/lib/faissext.py#L132
The new interface does not have Clustering.obj
any more, but rather Kmeans.obj
. Since this would be a quite big refactoring, I found it easiest to just downgrade to faiss==1.5.2
which binds the cuda version to 10.0
and thus pytorch=1.4.0
.
To drive this point home, one has to
conda install pytorch torchvision faiss-gpu==1.5.2 cudatoolkit=10.0 -c pytorch
I can make a PR if interested.
Thanks @theRealSuperMario ! Did you use python 3.7 ? Have you tested the training?
- [x] python3.7
Training is running
