Skip to content

Commit

Permalink
Pass a bool to setup_gpu for use_cudnn
Browse files Browse the repository at this point in the history
Since 0 evaluates as true in Lua, cudnn would always be required for cuda backends
  • Loading branch information
programmarchy committed Oct 13, 2016
1 parent 59204be commit 3659a8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fast_neural_style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ local function main()
error('Must give exactly one of -input_image or -input_dir')
end

local dtype, use_cudnn = utils.setup_gpu(opt.gpu, opt.backend, opt.use_cudnn)
local dtype, use_cudnn = utils.setup_gpu(opt.gpu, opt.backend, opt.use_cudnn == 1)
local ok, checkpoint = pcall(function() return torch.load(opt.model) end)
if not ok then
print('ERROR: Could not load model from ' .. opt.model)
Expand Down

0 comments on commit 3659a8a

Please sign in to comment.