Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion train.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ if opt.init_from ~= '' then
local checkpoint = torch.load(opt.init_from)
model = checkpoint.model:type(dtype)
if opt.reset_iterations == 0 then
start_i = checkpoint.i
-- Backward compatibility with checkpoints made before
-- reset_iterations was implemented:
if checkpoint.i == nil then
print(string.format('reset_iterations: %s contains no iteration counter',
opt.init_from))
else
start_i = checkpoint.i
end
end
else
model = nn.LanguageModel(opt_clone):type(dtype)
Expand Down