Hi Jianxu, Thank you for your continuous help! I tried 1 epoch with CIFAR and it worked.
I have now defined my small scale FCN and trying to put it to training. However, I am getting this error.
"
mini-batch supported only
stack traceback:
"
Below is my network and how I am setting it, can you please point me in the right direction, thanks!
-- data and labels:
print(trainset.data:size()) -- size is 10x3x64x64 i.e. 10 examples of 64x64 RGB image patches
print(trainset.label:size()) -- 10x64x64 i.e. class labels for each example, for me only two classes
-- the network architecture using nngraph
input = nn.Identity()()
L1 = nn.ReLU()(nn.SpatialFullConvolution(3,16,3,3,1,1,0,0,0,0)(input))
L2 = nn.ReLU()(nn.SpatialFullConvolution(16,16,3,3,1,1,0,0,0,0)(L1))
L3 = nn.SpatialMaxPooling(2,2,2,2)(L2)
L4 = nn.ReLU()(nn.SpatialFullConvolution(16,32,3,3,1,1,0,0,0,0)(L3))
L5 = nn.ReLU()(nn.SpatialFullConvolution(32,32,3,3,1,1,0,0,0,0)(L4))
L6 = nn.ReLU()(nn.SpatialFullConvolution(32,32,3,3,1,1,0,0,0,0)(L5))
L7 = nn.SpatialMaxPooling(2,2,2,2)(L6)
L8 = nn.ReLU()(nn.SpatialFullConvolution(32,64,3,3,1,1,0,0,0,0)(L7))
L9 = nn.ReLU()(nn.SpatialFullConvolution(64,64,3,3,1,1,0,0,0,0)(L8))
L10 = nn.ReLU()(nn.SpatialFullConvolution(64,64,3,3,1,1,0,0,0,0)(L9))
L11 = nn.SpatialMaxPooling(2,2,2,2)(L10)
L12 = nn.ReLU()(nn.SpatialFullConvolution(64,512,5,5,1,1,0,0,0,0)(L11))
L13 = nn.ReLU()(nn.SpatialFullConvolution(512,1,1,1,1,1,0,0,0,0)(L12))
L14 = nn.ReLU()(nn.SpatialFullConvolution(1,1,2,2,2,2,0,0,0,0)(L13))
L14c1 = nn.Narrow(2,1,20)(L14)
L14c2 = nn.Narrow(3,1,20)(L14c1)
PS1 = nn.ReLU()(nn.SpatialFullConvolution(32,1,1,1,1,1,0,0,0,0)(L7))
Fused1 = nn.CAddTable()({L14c2,PS1})
UFused1 = nn.ReLU()(nn.SpatialFullConvolution(1,1,2,2,2,2,0,0,0,0)(Fused1))
UFused1c1 = nn.Narrow(2,1,34)(UFused1)
UFused1c2 = nn.Narrow(3,1,34)(UFused1c1)
PS2 = nn.ReLU()(nn.SpatialFullConvolution(16,1,1,1,1,1,0,0,0,0)(L3))
Fused2 = nn.CAddTable()({UFused1c2,PS2})
UFused2 = nn.ReLU()(nn.SpatialFullConvolution(1,1,2,2,2,2,0,0,0,0)(Fused2))
UFused2c1 = nn.Narrow(2,1,64)(UFused2)
UFused2c2 = nn.Narrow(3,1,64)(UFused2c1)
net = nn.gModule({input},{UFused2c2})
-- setting the criterion
criterion = cudnn.SpatialCrossEntropyCriterion
trainer = nn.StochasticGradient(net, criterion)
trainer.learningRate = 0.0001
trainer.maxIteration = 1 -- just do 1 epochs of training i.e. just pass these 10 examples only once.
-- putt to training
trainer:train(trainset)
Thanks and Regards,
Touqeer