e2e-gLSTM-sc icon indicating copy to clipboard operation
e2e-gLSTM-sc copied to clipboard

Error while running both CPU or GPU mode

Open utsavgarg opened this issue 8 years ago • 10 comments

/home/torch/install/bin/luajit: /home/torch/install/share/lua/5.1/nn/Linear.lua:66: size mismatch at /home/torch/extra/cutorch/lib/THC/THCTensorMathBlas.cu:90 stack traceback: [C]: in function 'addmm' /home/babu/torch/install/share/lua/5.1/nn/Linear.lua:66: in function 'func' /home/babu/torch/install/share/lua/5.1/nngraph/gmodule.lua:345: in function 'neteval' /home/babu/torch/install/share/lua/5.1/nngraph/gmodule.lua:380: in function 'forward' ./misc_new/LanguageModel.lua:277: in function 'sample' eval_new.lua:135: in function 'eval_split' eval_new.lua:173: in main chunk [C]: in function 'dofile' ...babu/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00406620

utsavgarg avatar Dec 01 '16 05:12 utsavgarg

Please refer to the code for NeuralTalk2 to run the code. It seems like a size mismatch issue, please check ./misc_new/LanguageModel.lua:277: in function 'sample' to debug your settings.

Best

LuoweiZhou avatar Dec 01 '16 14:12 LuoweiZhou

I ran the NeuralTalk2 model and it runs fine. The error is in ./misc_new/LanguageModel.lua:198: in function 'sample' where xt is being defined. Its giving a size of 2 1536 instead of 2 768. What should I change in it so that it works fine ?

utsavgarg avatar Dec 02 '16 07:12 utsavgarg

Yup, same error with VGG as the input CNN.

arunmallya avatar Mar 03 '17 17:03 arunmallya

@LuoweiZhou i have the same error, neuraltalk2 works fine but this doesn't work any help please

MironaGamil avatar Apr 11 '17 12:04 MironaGamil

@utsavgarg Hi, sorry for the delay. Have you figured out the issues? It works fine for me when I train my model from scratch. It notes that the pre-trained model of NeuralTalk2 has 768 input states (LSTM) which might not be evaluated directly with our code. Also, we double the input size of LSTM to allow the text-conditional guidance, that's probably why the size of xt should be 1536 instead of 768.

LuoweiZhou avatar Apr 11 '17 15:04 LuoweiZhou

@arunmallya Hi, what model did you use to evaluate?

LuoweiZhou avatar Apr 11 '17 15:04 LuoweiZhou

@MironaGamil I assume you directly feed the NeuralTalk2 pre-trained model into the eval code which would not work since the LSTM input structure is not the same.

LuoweiZhou avatar Apr 11 '17 15:04 LuoweiZhou

I trained from scratch using your code. Using the model saved after the first step, i tried to run the second step, which then failed giving the error above.

arunmallya avatar Apr 11 '17 15:04 arunmallya

@arunmallya Just want to confirm. So, you got the error while fine-tuning the model? Or same as others while having the evaluation?

LuoweiZhou avatar Apr 11 '17 15:04 LuoweiZhou

Yes, I got the error while training/fine-tuning. I used the following commands:

  1. th train_new.lua -max_iters 250000 -finetune_cnn_after 100000
  2. th train_sc.lua -max_iters 150000 -start_from <model_of_step_2>.t7

arunmallya avatar Apr 11 '17 15:04 arunmallya