Comments (10)
You have 2 classes but you give 10 output from the logsoftmax.
from cvpr2015.
I changed the line net:add(nn.Linear(84, 10) to net:add(nn.Linear(84, 2), but the error remains.
Help. I'm new to this.
from cvpr2015.
Your batch size is very big. It could be the problem. Try with smaller batch.
from cvpr2015.
Does not work. could you help me with the correct data?
My goal is that the neural network can distinguish human from animal.
from cvpr2015.
net:add(nn.View(1699))
must be
net:add(nn.View(5184)).
for 181816.
I dont know what the problem is directly. It says something about batch size. Is this the full error message.
from cvpr2015.
New error!
nn.Sequential {
[input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> (7) -> (8) -> (9) -> (10) -> (11) -> (12) -> (13) -> output]
(1): nn.SpatialConvolution(3 -> 6, 18x18)
(2): nn.ReLU
(3): nn.SpatialMaxPooling(2x2, 2,2)
(4): nn.SpatialConvolution(6 -> 16, 18x18)
(5): nn.ReLU
(6): nn.SpatialMaxPooling(2x2, 2,2)
(7): nn.View(5184)
(8): nn.Linear(5184 -> 120)
(9): nn.ReLU
(10): nn.Linear(120 -> 84)
(11): nn.ReLU
(12): nn.Linear(84 -> 2)
(13): nn.LogSoftMax
}
[0.0371s]
th> criterion = nn.ClassNLLCriterion()
[0.0761s]
th>
[0.0000s]
th> trainer = nn.StochasticGradient(net, criterion)
[0.0001s]
th> trainer.learningRate = 0.001
[0.0000s]
th> trainer.maxIteration = 5
[0.0000s]
th> trainer:train(trainset)
StochasticGradient: training
.../facedetect/torch/install/share/lua/5.1/nn/Container.lua:67:
In 7 module of nn.Sequential:
/root/facedetect/torch/install/share/lua/5.1/nn/View.lua:47: input view (16x11x11) and desired view (5184) do not match
stack traceback:
[C]: in function 'error'
/root/facedetect/torch/install/share/lua/5.1/nn/View.lua:47: in function 'batchsize'
/root/facedetect/torch/install/share/lua/5.1/nn/View.lua:79: in function </root/facedetect/torch/install/share/lua/5.1/nn/View.lua:77>
[C]: in function 'xpcall'
.../facedetect/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
...facedetect/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
...ct/torch/install/share/lua/5.1/nn/StochasticGradient.lua:35: in function 'train'
[string "_RESULT={trainer:train(trainset)}"]:1: in main chunk
[C]: in function 'xpcall'
/root/facedetect/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl'
...tect/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x004064f0
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'
.../facedetect/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
...facedetect/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
...ct/torch/install/share/lua/5.1/nn/StochasticGradient.lua:35: in function 'train'
[string "_RESULT={trainer:train(trainset)}"]:1: in main chunk
[C]: in function 'xpcall'
/root/facedetect/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl'
...tect/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x004064f0
[0.3159s]
it looked at the beginning:
th> net:add(nn.View(16x9x9)) not "net:add(nn.View(1699))"
th> net:add(nn.Linear(16x9x9, 120)) not "net:add(nn.Linear(1699, 120))"
from cvpr2015.
Ok. 16 x 11 x 11 would be correct.
from cvpr2015.
I replaced it and did from the beginning:
th> net:add(nn.SpatialConvolution(3, 6, 9, 9))
th> net:add(nn.SpatialConvolution(6, 16, 9, 9))
th> net:add(nn.View(16x9x9))
th> net:add(nn.Linear(16x9x9, 120))
net = nn.Sequential()
net:add(nn.SpatialConvolution(3, 6, 11, 11))
net:add(nn.ReLU())
net:add(nn.SpatialMaxPooling(2,2,2,2))
net:add(nn.SpatialConvolution(6, 16, 11, 11))
net:add(nn.ReLU())
net:add(nn.SpatialMaxPooling(2,2,2,2))
net:add(nn.View(16x11x11))
net:add(nn.Linear(16x11x11, 120))
net:add(nn.ReLU())
net:add(nn.Linear(120, 84))
net:add(nn.ReLU())
net:add(nn.Linear(84, 2))
net:add(nn.LogSoftMax())
Error:
th> trainer:train(trainset)
StochasticGradient: training
.../facedetect/torch/install/share/lua/5.1/nn/Container.lua:67:
In 7 module of nn.Sequential:
/root/facedetect/torch/install/share/lua/5.1/nn/View.lua:47: input view (16x16x16) and desired view (1936) do not match
stack traceback:
[C]: in function 'error'
/root/facedetect/torch/install/share/lua/5.1/nn/View.lua:47: in function 'batchsize'
/root/facedetect/torch/install/share/lua/5.1/nn/View.lua:79: in function </root/facedetect/torch/install/share/lua/5.1/nn/View.lua:77>
[C]: in function 'xpcall'
.../facedetect/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
...facedetect/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
...ct/torch/install/share/lua/5.1/nn/StochasticGradient.lua:35: in function 'train'
[string "_RESULT={trainer:train(trainset)}"]:1: in main chunk
[C]: in function 'xpcall'
/root/facedetect/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl'
...tect/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x004064f0
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'
.../facedetect/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
...facedetect/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
...ct/torch/install/share/lua/5.1/nn/StochasticGradient.lua:35: in function 'train'
[string "_RESULT={trainer:train(trainset)}"]:1: in main chunk
[C]: in function 'xpcall'
/root/facedetect/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl'
...tect/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x004064f0
write 16x16x16
next error:
input view (16x12x12) and desired view (4096) do not match
maybe I'm not there to change the value?
from cvpr2015.
how to determine these parameters:
5x5 convolution kernel?
net:add(nn.SpatialConvolution(3, 6, 5, 5))
reshapes from a 3D tensor of 16x5x5 into 1D tensor of 1655?
net:add(nn.View(1655))
from cvpr2015.
Convolution makes your pictures smaller by m-1 n-1 where mxn is your filter. Subsampling makes a division over size. Your pictures are 96x96. 5x5 convolution will make them 92x92 if used without padding. Search about convolution and pooling.
from cvpr2015.
Related Issues (19)
- How is the file cifar10-train.t7 organise?
- Running time HOT 13
- Displays nothing HOT 4
- What is the fatest and easiest way to create training data and test data by video cameras?
- How to create a .t7 model from scratch(raw images & labels)? I tried to give raw images and labels by seeing train-face-detector example..i stuck at /home/naresh/torch/install/bin/lua: bad argument #2 to '?' (out of range at /tmp/luarocks_torch-scm-1-2338/torch7/generic/Tensor.c:890) error..Can anyone please tell me how to give raw images and labels for training cnn in torch framework..i want to do classification for images.
- How to run "Deep Learning with Torch.ipynb"? HOT 2
- It's cool
- Solving installation problems - Can't find kernel, missing env dependency.
- How do I know the GPU is being used when I run the Deep Learning ... notebook? HOT 3
- Tutorial fails on the GPU part with 'cunn' - training with SGD HOT 5
- How create data.t7 from imageset
- The tutorial Deep Learning with Torch has maybe issues
- Replace softmax
- (Just a doubt..!?) How to create a .t7 model from scratch(raw images & labels)? HOT 2
- Tutorial fails on the last line when trying to train with GPU HOT 2
- Nonlinearities missing between Linear layers in "Deep Learning with Torch: the 60-minute blitz" HOT 2
- itorch image not displaying images HOT 4
- Error when calling :forward() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cvpr2015.