aimagelab / VKD

PyTorch code for ECCV 2020 paper: "Robust Re-Identification by Multiple Views Knowledge Distillation"
MIT License
73 stars 15 forks source link

RuntimeError: result type Long can't be cast to the desired output type Bool #13

Closed Soar-Sir closed 3 years ago

Soar-Sir commented 3 years ago

Hi, guys:

First of all, thank you for your outstanding work, but when I was training the teacher network, I encountered such a problem.

python train_v2v.py mars --backbone resnet50 --num_train_images 8 --p 4 --k 4 --exp_name base_mars_resnet50 --first_milestone 100 --step_milestone 100

=> MARS loaded Dataset statistics:

subset | # ids | # tracklets | # images

train | 625 | 8298 | 509914 query | 626 | 1980 | 114493 gallery | 622 | 9330 | 543216

total | 1251 | 19608 | 1167623

number of images per tracklet: 2 ~ 920, average 59.5

EXP_NAME: base_mars_resnet50 Traceback (most recent call last): File "train_v2v.py", line 125, in main() File "train_v2v.py", line 96, in main triplet_loss_batch = triplet_loss(embeddings, y) File "/home/fei/code/VKD/model/loss.py", line 208, in call return super(OnlineTripletLoss, self).call(*args, *kwargs) File "/home/fei/anaconda3/envs/VKD/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, **kwargs) File "/home/fei/code/VKD/model/loss.py", line 146, in forward negative_mask = same_id_mask ^ 1 RuntimeError: result type Long can't be cast to the desired output type Bool

How can I fix it ?

Soar-Sir commented 3 years ago

Besides, can you share the "test_track.txt" in VeRi776? This file was not included in their original dataset. Thanks a lot!

angpo commented 3 years ago

Hi,

The error is probably due to the new version of Pytorch; however, you can fix it by replacing the "1" with "True" (as suggested here).

Regarding VeRi776, you can download from here the file you are looking for.