Giter Club home page Giter Club logo

Comments (7)

zuoeye avatar zuoeye commented on July 17, 2024

My Data is 28283. So I Just copy the model_def of FRGC to build my network architecture. Is this the reason of the trouble?Then,how to define my own network architecture to train the model on images with size 28*28?

from jule.torch.

jwyang avatar jwyang commented on July 17, 2024

Yes, I think that might be the reason. FRGC is 32x32, so the output feature dimesion of the network might be wrong for you 28x28 images. You can try the architecture for MNIST, since it is also 28x28.

from jule.torch.

zuoeye avatar zuoeye commented on July 17, 2024

Thanks for your answer, but there is still probelm when I tried architecture for MNIST:

`online epoch # 0 [batchSize = 100] [learningRate = 0.01]
/home/ai/torch/install/bin/luajit: /home/ai/torch/install/share/lua/5.1/nn/Container.lua:67:
In 2 module of nn.Sequential:
In 1 module of nn.Sequential:
In 1 module of nn.Sequential:
/home/ai/torch/install/share/lua/5.1/nn/THNN.lua:110: Need input of dimension 4 and input.size[1] == 1 but got input to be of shape: [100 x 3 x 28 x 28] at /tmp/luarocks_cunn-scm-1-3260/cunn/lib/THCUNN/generic/SpatialConvolutionMM.cu:49
stack traceback:
[C]: in function 'v'
/home/ai/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'SpatialConvolutionMM_updateOutput'
...ai/torch/install/share/lua/5.1/nn/SpatialConvolution.lua:79: in function <...ai/torch/install/share/lua/5.1/nn/SpatialConvolution.lua:76>
[C]: in function 'xpcall'
/home/ai/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/ai/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function </home/ai/torch/install/share/lua/5.1/nn/Sequential.lua:41>
[C]: in function 'xpcall'
/home/ai/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/ai/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function </home/ai/torch/install/share/lua/5.1/nn/Sequential.lua:41>
[C]: in function 'xpcall'
/home/ai/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/ai/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
train.lua:421: in function 'opfunc'
/home/ai/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'sgd'
train.lua:436: in function 'updateCNN'
train.lua:487: in main chunk
[C]: in function 'dofile'
...e/ai/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00406670

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/ai/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
/home/ai/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
train.lua:421: in function 'opfunc'
/home/ai/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'sgd'
train.lua:436: in function 'updateCNN'
train.lua:487: in main chunk
[C]: in function 'dofile'
...e/ai/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00406670`

I think that It may be my data is three-channel RGB data. I found FRGC is the three-channel RGB data. Then I resize my data to 33232. But there is still trouble when I tried architecture for FRGC:

==> online epoch # 0 [batchSize = 100] [learningRate = 0.01] loss: 0.037374177345863 /home/ai/torch/install/bin/luajit: bad argument #2 to '?' (out of range at /home/ai/torch/pkg/torch/generic/Tensor.c:913) stack traceback: [C]: at 0x7f453c6d9b30 [C]: in function '__index' train.lua:366: in function 'organize_samples' train.lua:422: in function 'opfunc' /home/ai/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'sgd' train.lua:436: in function 'updateCNN' train.lua:487: in main chunk [C]: in function 'dofile' ...e/ai/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00406670

Do you know how to do? Or can you teach me how to build my network architecture. Especially, how to choose the parameters in the model_def? For example, how to choose the parameters of nInputPlanes, nOutputPlanes, nn.View, nn.Linear, nn.Normalize in the model_def?

from jule.torch.

zuoeye avatar zuoeye commented on July 17, 2024

Hello, I'm waiting for your answer. Kindly favour me with an early reply. Thank you.

from jule.torch.

jwyang avatar jwyang commented on July 17, 2024

Have you solved the problem? I think you need to convert you data to 3 channels. SInce the architecture for FRGC merely takes 3 channels as input.

Also, please remember to give the groundtruth labels. If you do not have, then randomly initialize the labels in advance.

from jule.torch.

dcharua avatar dcharua commented on July 17, 2024

Hi I have the same issue, ran it on the FRGC with 3 channels, but got

/home/lifelogging/torch/install/bin/luajit: bad argument #2 to '?' (out of range at /home/lifelogging/torch/pkg/torch/generic/Tensor.c:913)
stack traceback:
[C]: at 0x7f1af1a2bb60
[C]: in function '__index'
train.lua:368: in function 'organize_samples'
train.lua:424: in function 'opfunc'
/home/lifelogging/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'sgd'
train.lua:438: in function 'updateCNN'
train.lua:489: in main chunk
[C]: in function 'dofile'
...ging/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

were you able to solve this?

Thank you

from jule.torch.

dcharua avatar dcharua commented on July 17, 2024

The problem is with the data, it needs to be in the correct format a 32float
so the header of the h5 should look like this

HDF5 "data4torch.h5" {
GROUP "/" {
DATASET "data" {
DATATYPE H5T_IEEE_F32LE
DATASPACE SIMPLE { ( 35898, 3, 32, 32 ) / ( 35898, 3, 32, 32 ) }
}
DATASET "labels" {
DATATYPE H5T_IEEE_F32LE
DATASPACE SIMPLE { ( 35898 ) / ( 35898 ) }
}
}
}

from jule.torch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.