diff --git a/neural_style.lua b/neural_style.lua index adc7621..c21cb5f 100644 --- a/neural_style.lua +++ b/neural_style.lua @@ -50,6 +50,9 @@ cmd:option('-style_layers', 'relu1_1,relu2_1,relu3_1,relu4_1,relu5_1', 'layers f local function main(params) + if params.seed >= 0 then + torch.manualSeed(params.seed) + end local dtype, multigpu = setup_gpu(params) local loadcaffe_backend = params.backend @@ -195,9 +198,6 @@ local function main(params) collectgarbage() -- Initialize the image - if params.seed >= 0 then - torch.manualSeed(params.seed) - end local img = nil if params.init == 'random' then img = torch.randn(content_image:size()):float():mul(0.001)