I designed a network like this
training net
nn.Sequential {
[input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> output]
(1): cudnn.SpatialConvolution(1 -> 112, 3x3)
(2): cudnn.ReLU
(3): nn.ConcatTable {
input
|`-> (1): nn.Sequential {
| [input -> (1) -> (2) -> output]
| (1): cudnn.SpatialConvolution(112 -> 112, 3x3)
| (2): cudnn.ReLU
| }
`-> (2): nn.SpatialMaxPooling(7x7)
... -> output
}
testing net (keeping the same size of the image while extracting features)
nn.Sequential {
[input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> output]
(1): cudnn.SpatialConvolution(1 -> 112, 3x3, 1,1, 1,1)
(2): cudnn.ReLU
(3): nn.ConcatTable {
input
|`-> (1): nn.Sequential {
| [input -> (1) -> (2) -> output]
| (1): cudnn.SpatialConvolution(112 -> 112, 3x3, 1,1, 1,1)
| (2): cudnn.ReLU
| }
`-> (2): nn.SpatialMaxPooling(7x7, 1,1, 3,3)
... -> output
}
Training it in patches and test it on the entire images (fully convolutional network)
During training everything is ok. But while testing I got an error
luajit: /home/x/torch/install/share/lua/5.1/nn/Container.lua:70:
In 3 module of nn.Sequential:
bad argument #1 to '?' (empty tensor)
stack traceback:
[C]: at 0x7f47002de0e0
[C]: in function '__newindex'
/home/x/torch/install/share/lua/5.1/nn/ConcatTable.lua:13: in function </home/x/torch/install/share/lua/5.1/nn/ConcatTable.lua:9>
[C]: in function 'xpcall'
/home/x/torch/install/share/lua/5.1/nn/Container.lua:66: in function 'rethrowErrors'
/home/x/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/home/x/torch/install/share/lua/5.1/optnet/init.lua:387: in function 'optimizeMemory'
./main.lua:1933: in function 'stereo_predict'
./main.lua:2181: in main chunk
[C]: at 0x00405e40
WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
[C]: in function 'error'
/home/x/torch/install/share/lua/5.1/nn/Container.lua:70: in function 'rethrowErrors'
/home/x/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
/home/x/torch/install/share/lua/5.1/optnet/init.lua:387: in function 'optimizeMemory'
./main.lua:1933: in function 'stereo_predict'
./main.lua:2181: in main chunk
[C]: at 0x00405e40
After debuging, I found the error is related to the 2nd cudnn.ReLU, But still don't know why?
Could someone help me ?