RecNet icon indicating copy to clipboard operation
RecNet copied to clipboard

Bug report

Open MarcusNerva opened this issue 4 years ago • 0 comments

Greetings, homie!

I find at least two bugs in your code:

  1. line 100 in RecNet/utils.py: reconstruction_loss = torch.zeros(1) is on cpu. You should move it to GPU. Or you will get RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! Thus: reconstruction_loss = torch.zeros(1).to(cross_entropy_loss.device) will fix this bug.

  2. line 132 in RecNet/utils.py: onlyonce_iter.append(( vids[:batch_size], torch.stack(feats[:batch_size]) )). This yield TypeError: 'dict_keys' object is not subscriptable. vids = list(onlyonce_dataset.keys()) and feats = onlyonce_dataset.values() will fix this problem.

MarcusNerva avatar Apr 08 '21 02:04 MarcusNerva