Closed qcl1994 closed 6 years ago
Hello, thank you for pointing this out.
This seems to be an issue with the PIL library and cropping, line #L52 in genericdataset.py. The bbx can be a float in our case, and PIL version 4.3.0 that we use is ok with the float input. However, for you this seems to be a problem. Can you please tell me which PIL version are you using because I cannot reproduce this error?
One solution would be to try and update PIL to a more recent version.
Second solution would be to replace #L52 with these two lines (I hope this will work):
bbx = tuple([int(round(b)) for b in self.bbx[index])
img = img.crop(bbx)
I currently have a limited computer access, so I cannot test the code and the update by myself, but I will try to do it as soon as possible and make a revision. I hope that my suggestions will help you so that you can continue working immediately. Let me know if it helped.
Thank u for you quick response! My PIL library version is 3.1.2. I will try these two silutions!
Hi, I used python3 to train the network, but there seems to be something wrong. Could you give me some advice? Thank u!
qiuchenli@qiuchenli-GS43VR-7RE:~/deeplearn_loop/pytorch-cnnimageretrieval/cnnimageretrieval-pytorch$ python3 -m cirtorch.examples.train YOUR_EXPORT_DIR --gpu-id '0' --training-dataset 'retrieval-SfM-120k' --test-datasets 'roxford5k,rparis6k' --arch 'resnet101' --pool 'gem' --loss 'contrastive' --loss-margin 0.85 --optimizer 'adam' --lr 1e-6 --neg-num 5 --query-size=2000 --pool-size=20000 --batch-size 5 --image-size 362