SCNN
SCNN copied to clipboard
Training error after modifying nn.View and nn.Linear
I simply remove the nn.View(4500) and insert a new nn.View(4500) in SCNN-gen.lua, as the following shows:
classifier = model:get(44):get(2)
classifier:remove(3)
classifier:insert(nn.View(4500), 3)
classifier:remove(4)
classifier:insert(nn.Linear(4500, 128), 4)
Error comes durining training:
/home/lishanliao/torch/install/bin/luajit:` ...shanliao/torch/install/share/lua/5.1/threads/threads.lua:183: [thread 2 callback] .../lishanliao/torch/install/share/lua/5.1/nn/Container.lua:67:
In 44 module of nn.Sequential:
In 2 module of nn.ConcatTable:
In 7 module of nn.Sequential:
/home/lishanliao/torch/install/share/lua/5.1/nn/THNN.lua:110: output and gradOutput have different number of elements: output[4] has 4 elements, while gradOutput[3] has 3 elements at /home/lishanliao/torch/extra/cunn/lib/THCUNN/generic/Sigmoid.cu:23
What's wrong???
@XingangPan Can you release the code to generate vgg.t7 please ?
Try doing
classifier: insert(nn.Linear(4500, 128), 3)
instead
(edit) I'm sorry, but my response is incorrect. See what @cardwing suggested.
@juntawu , @virajdeokar , please refer to this issue 143.
@juntawu What's your GPU's number and it's memory?
@leofanpico 7 GPUs, 8 G per GPU