create new directory when the specified directory is not found
This commit is contained in:
parent
83a8cbe3bd
commit
3a70d09921
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue