Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad argument #3 to 'v' when using VolumetricConvolution #1056

Closed
kuixu opened this issue Dec 1, 2016 · 3 comments
Closed

bad argument #3 to 'v' when using VolumetricConvolution #1056

kuixu opened this issue Dec 1, 2016 · 3 comments

Comments

@kuixu
Copy link
Contributor

kuixu commented Dec 1, 2016

The input is a 3D image and the input size is [32, 30, 30, 30], which batchSize=32, Height x Width x Length = 30 x 30 x 30

/home/scs4850/torch/install/bin/luajit: /home/scs4850/torch/install/share/lua/5.1/nn/Container.lua:67: 
In 1 module of nn.Sequential:
/home/scs4850/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #3 to 'v' (cannot convert 'struct THFloatTensor *' to 'struct THCudaTensor *')
stack traceback:
        [C]: in function 'v'
        /home/scs4850/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'VolumetricConvolution_updateOutput'
        ...torch/install/share/lua/5.1/nn/VolumetricConvolution.lua:52: in function <...torch/install/share/lua/5.1/nn/VolumetricConvolution.lua:48>
        [C]: in function 'xpcall'
        /home/scs4850/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
        /home/scs4850/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
        ./train.lua:57: in function 'train'
        main.lua:49: in main chunk
        [C]: in function 'dofile'
        ...4850/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: 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/scs4850/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
        /home/scs4850/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
        ./train.lua:57: in function 'train'
        main.lua:49: in main chunk
        [C]: in function 'dofile'
        ...4850/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x00406670

I really don't know what's wrong with that. Anyone here can help me ?

@gchanan
Copy link
Contributor

gchanan commented Dec 6, 2016

It looks like your input is of type CudaTensor, but the module isn't of that type. See some examples in the cunn tests, you probably want to call :cuda() on the module you are passing the input to, e.g. nn.Sequential(...):cuda() or nn.VolumetricConvolution(...):cuda() (remember to require 'cunn').

@soumith soumith closed this as completed Dec 7, 2016
@kuixu
Copy link
Contributor Author

kuixu commented Dec 8, 2016

@gchanan Thanks for your advice! It works now! And sorry for the late feedback.

@NerminSalem
Copy link

@barrykui how did u make it work?
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants