lzrobots / LearningToCompare_ZSL

PyTorch code for CVPR 2018 paper: Learning to Compare: Relation Network for Few-Shot Learning (Zero-Shot Learning part)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

some trouble in pytorch 0.4.0

wang1104014663 opened this issue · comments

when I run awa1.py
there are some question.

File "E:/deeplearning/LearningToCompare_ZSL-master/AwA1_RN.py", line 256, in
rewards = [1 if predict_labels[j]==re_batch_labels[j] else 0 for j in range(batch_size)]
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #2 'other'

Hi, you just need to modify the variable to be compatible with CUDA

  •                re_batch_labels = torch.LongTensor(re_batch_labels)
  •                re_batch_labels = torch.LongTensor(re_batch_labels).cuda(GPU)