We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5061df5 commit 2fe796bCopy full SHA for 2fe796b
tutorials/09 - Image Captioning/train.py
@@ -55,12 +55,11 @@ def main():
55
# Set mini-batch dataset
56
images = Variable(images)
57
captions = Variable(captions)
58
- targets = pack_padded_sequence(captions, lengths, batch_first=True)[0]
59
-
60
if torch.cuda.is_available():
61
images = images.cuda()
62
captions = captions.cuda()
63
+ targets = pack_padded_sequence(captions, lengths, batch_first=True)[0]
+
64
# Forward, Backward and Optimize
65
decoder.zero_grad()
66
encoder.zero_grad()
0 commit comments