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 #4 to 'v' (cannot convert 'struct THCudaLongTensor *' to 'struct THCudaTensor *') #10

Closed
SeekPoint opened this issue Nov 23, 2016 · 4 comments

Comments

@SeekPoint
Copy link

rzai@rzai00:~/prj/icml2016$ bash scripts/train_coco_txt.sh
{
img_dir : "/media/rzai/ai_data/VQA-ALL/mscoco.org-visualqa.org/train2014"
beta1 : 0.5
nThreads : 6
txtSize : 1024
niter : 200
batchSize : 256
lr_decay : 0.5
fineSize : 64
use_cudnn : 1
init_t : ""
numCaption : 1
loadSize : 76
print_every : 4
encoder : "gru18"
name : "coco_gru18_bs256_c512"
gpu : 1
checkpoint_dir : "checkpoints"
dataset : "coco_txt"
filenames : ""
lr : 0.0002
ntrain : inf
decay_every : 50
save_every : 5
data_root : "/home/rzai/_reedscot/de_coco_icml.tar.gz/train2014_ex_t7"
doc_length : 201
cnn_dim : 512
display_id : 101
display : 0
}
Random Seed: 3243
Starting donkey with id: 1 seed: 3244
Starting donkey with id: 5 seed: 3248
Starting donkey with id: 4 seed: 3247
Starting donkey with id: 2 seed: 3245
Starting donkey with id: 3 seed: 3246
Starting donkey with id: 6 seed: 3249
Dataset: coco_txt Size: 82783
Warning: cudnn.convert does not work with nngraph yet. Ignoring nn.gModuleWarning: cudnn.convert does not work with nngraph yet. Ignoring nn.gModule/home/rzai/torch/install/bin/luajit: /home/rzai/torch/install/share/lua/5.1/nn/Container.lua:67:
In 3 module of nn.Sequential:
/home/rzai/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #4 to 'v' (cannot convert 'struct THCudaLongTensor *' to 'struct THCudaTensor *')
stack traceback:
[C]: in function 'v'
/home/rzai/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'TemporalMaxPooling_updateOutput'
...ai/torch/install/share/lua/5.1/nn/TemporalMaxPooling.lua:19: in function <...ai/torch/install/share/lua/5.1/nn/TemporalMaxPooling.lua:12>
[C]: in function 'xpcall'
/home/rzai/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/rzai/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'func'
/home/rzai/torch/install/share/lua/5.1/nngraph/gmodule.lua:345: in function 'neteval'
/home/rzai/torch/install/share/lua/5.1/nngraph/gmodule.lua:380: in function 'forward'
main_txt_coco.lua:181: in function 'opfunc'
/home/rzai/torch/install/share/lua/5.1/optim/adam.lua:37: in function 'adam'
main_txt_coco.lua:207: in main chunk
[C]: in function 'dofile'
...rzai/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/rzai/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
/home/rzai/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'func'
/home/rzai/torch/install/share/lua/5.1/nngraph/gmodule.lua:345: in function 'neteval'
/home/rzai/torch/install/share/lua/5.1/nngraph/gmodule.lua:380: in function 'forward'
main_txt_coco.lua:181: in function 'opfunc'
/home/rzai/torch/install/share/lua/5.1/optim/adam.lua:37: in function 'adam'
main_txt_coco.lua:207: in main chunk
[C]: in function 'dofile'
...rzai/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
rzai@rzai00:~/prj/icml2016$

@SeekPoint
Copy link
Author

misreport

this is caused by fb.torch!

@ChenSongle
Copy link

I spent several days to solve this problem, including update cutorch, cunn and so on, but the error still existed. In fact, you should convert the input into CudaTensor. I fixed this problem by adding the convert layer(Convert.lua) before convolution layer.

@mpapadomanolaki
Copy link

@ChenSongle could you tell me how exactly did you use the convert layer??
I have a similar problem but I can't solve it, I don't know what I'm missing..
Thank you : )

@ChenSongle
Copy link

@mpapadomanolaki
--below is an example
agentinput2 = nn.Sequential()
agentinput2:add(nn.Convert(ds:ioShapes(), ds:ioShapes())) --only for convert to cuda
--here, ds is the object of ImageSet or other datasource

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

3 participants