Skip to content

Commit 12afd0b

Browse files
authored
Merge pull request yunjey#30 from keishinkickback/master
Bug fixes in /tutorials/09 - Image Captioning/train.py
2 parents 25ce830 + b2c7bd7 commit 12afd0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/09 - Image Captioning/train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import torch.nn as nn
44
import numpy as np
55
import os
6+
import pickle
67
from data_loader import get_loader
78
from build_vocab import Vocabulary
89
from model import EncoderCNN, DecoderRNN
@@ -24,7 +25,7 @@ def main(args):
2425
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
2526

2627
# Load vocabulary wrapper.
27-
with open(vocab_path, 'rb') as f:
28+
with open(args.vocab_path, 'rb') as f:
2829
vocab = pickle.load(f)
2930

3031
# Build data loader
@@ -115,4 +116,3 @@ def main(args):
115116
parser.add_argument('--learning_rate', type=float, default=0.001)
116117
args = parser.parse_args()
117118
print(args)
118-
main(args)

0 commit comments

Comments
 (0)