torch / torch7

http://torch.ch
Other
9k stars 2.38k forks source link

MSECriterion error in cuda9 and cudnn7 #1192

Closed ajhool closed 5 years ago

ajhool commented 5 years ago

I'm seeing the following showstopper error on ubuntu16.04 with cuda9 and cudnn7, does anybody have any ideas?

The input is an image. Would this error occur if the image wasn't loading properly?

/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/nn/Container.lua:67:
In 4 module of nn.Sequential:
/root/torch/install/share/lua/5.1/nn/THNN.lua:110: input and target have different number of elements: input[64 x 64] has 4096 elements, while target[] has 0 elements at /tmp/luarocks_cunn-scm-1-5152/cunn/lib/THCUNN/generic/MSECriterion.cu:12
stack traceback:
[C]: in function 'v'
/root/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'MSECriterion_updateOutput'
/root/torch/install/share/lua/5.1/nn/MSECriterion.lua:14: in function 'forward'
scripts/neural_style.lua:593: in function <scripts/neural_style.lua:581>
[C]: in function 'xpcall'
/root/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/root/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
scripts/neural_style.lua:267: in function 'main'
stu17682 commented 5 years ago

Hey there Looks like the array of target labels is actually empty, so could be worth double-checking the code. Hope this helps. Cheers Stuart

-- Stuart Millar PhD Deep Learning / Cyber Security Researcher CSIT / QUB, Belfast smillar09@qub.ac.ukmailto:smillar09@qub.ac.uk

Sent from my iPhone - please excuse any typos or grammatical errors.

On 26 Jan 2019, at 05:09, ajhool notifications@github.com<mailto:notifications@github.com> wrote:

I'm seeing the following showstopper error on ubuntu16.04 with cuda9 and cudnn7, does anybody have any ideas?

The input is an image. Would this error occur if the image wasn't loading properly?

/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/nn/Container.lua:67: In 4 module of nn.Sequential: /root/torch/install/share/lua/5.1/nn/THNN.lua:110: input and target have different number of elements: input[64 x 64] has 4096 elements, while target[] has 0 elements at /tmp/luarocks_cunn-scm-1-5152/cunn/lib/THCUNN/generic/MSECriterion.cu:12 stack traceback: [C]: in function 'v' /root/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'MSECriterion_updateOutput' /root/torch/install/share/lua/5.1/nn/MSECriterion.lua:14: in function 'forward' scripts/neural_style.lua:593: in function <scripts/neural_style.lua:581> [C]: in function 'xpcall' /root/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors' /root/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward' scripts/neural_style.lua:267: in function 'main'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/torch/torch7/issues/1192, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQFdsJZXUNwp0GtfgDfsgOtwwhuujzqYks5vG-LtgaJpZM4aT_4h.

ajhool commented 5 years ago

This problem went away "magically," but I believe my code was not finding an image file properly, leading to this empty error. Thanks @stu17682