1
0
Fork 0
mirror of synced 2024-05-14 18:02:20 +12:00

create new directory when the specified directory is not found

This commit is contained in:
nagadomi 2016-08-30 17:13:25 +09:00
parent 83a8cbe3bd
commit 3a70d09921
2 changed files with 5 additions and 0 deletions

View file

@ -77,6 +77,9 @@ to_bool(opt, "show_progress")
if opt.thread > 0 then
torch.setnumthreads(tonumber(opt.thread))
end
if opt.output_dir:len() > 0 then
dir.makepath(opt.output_dir)
end
local function rgb2y_matlab(x)
local y = torch.Tensor(1, x:size(2), x:size(3)):zero()

View file

@ -301,6 +301,8 @@ local function train()
else
model = srcnn.create(settings.model, settings.backend, settings.color)
end
dir.makepath(settings.model_dir)
local offset = reconstruct.offset_size(model)
local pairwise_func = function(x, is_validation, n)
return transformer(model, x, is_validation, n, offset)