Model: Use opt.imgDim for retraining

\cc @melgor

Ideally I should have made imgDim part of the model.
This works for now, but users training will need to be
careful about this size.
This commit is contained in:
Brandon Amos 2016-04-05 18:01:15 -04:00
parent 98c42a057c
commit 66efcb706b
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ if opt.retrain ~= 'none' then
assert(paths.filep(opt.retrain), 'File not found: ' .. opt.retrain)
print('Loading model from file: ' .. opt.retrain);
model = torch.load(opt.retrain)
print("Using imgDim = ", opt.imgDim)
else
paths.dofile(opt.modelDef)
assert(imgDim, "Model definition must set global variable 'imgDim'")
@ -37,7 +38,7 @@ if opt.cuda then
criterion:cuda()
end
optimizeNet(model, imgDim)
optimizeNet(model, opt.imgDim)
print('=> Model')
print(model)