RecNet
RecNet copied to clipboard
Bug report
Greetings, homie!
I find at least two bugs in your code:
-
line 100 in RecNet/utils.py:
reconstruction_loss = torch.zeros(1)is on cpu. You should move it to GPU. Or you will getRuntimeError: 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. -
line 132 in RecNet/utils.py:
onlyonce_iter.append(( vids[:batch_size], torch.stack(feats[:batch_size]) )). This yieldTypeError: 'dict_keys' object is not subscriptable.vids = list(onlyonce_dataset.keys())andfeats = onlyonce_dataset.values()will fix this problem.