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

evaluate_model error of 'bad argument' #76

Open
sujing1 opened this issue Oct 26, 2017 · 3 comments
Open

evaluate_model error of 'bad argument' #76

sujing1 opened this issue Oct 26, 2017 · 3 comments

Comments

@sujing1
Copy link

sujing1 commented Oct 26, 2017

Hello,
I get error when running 'evaluate_model.lua'. It appears with both VG 1.0 and 1.2:
THNN.lua:110: bad argument #8 to 'v' (cannot convert 'nil' to 'int64_t')

Any suggestions are highly appreciated!

Steps

  1. Necessary packages are installed as from the Installation guideline

  2. Image preprocessing succeeds with
    python preprocess.py --region_data ~/data/VG2015/region_descriptions.json --image_dir ~/data/VG2015/VG_100K --image_size 720 --split_json info/densecap_splits.json --json_output ~/data/VG2015/VG_100k_sorted.json --h5_output ~/data/VG2015/VG_100k_sorted.hdf5 --num_workers 6

  3. Error comes with
    th evaluate_model.lua -checkpoint data/models/densecap/densecap-pretrained-vgg16.t7 -split val -gpu 0 -use_cudnn 0 -num_proposals 300 -data_h5 ~/data/VG2015/VG_100k_sorted.hdf5 -data_json ~/data/VG2015/VG_100k_sorted.json

Loaded model
Using dtype "torch.CudaTensor"
DataLoader loading json file: /home/sujing/data/VG2015/VG_100k_sorted.json
DataLoader loading h5 file: /home/sujing/data/VG2015/VG_100k_sorted.hdf5
reading box_to_img
reading boxes
reading image_heights
reading image_widths
reading img_to_first_box
reading img_to_last_box
reading labels
reading lengths
reading original_heights
reading original_widths
reading split
assigned 77396/5000/5000 images to train/val/test.
initialized DataLoader:
#images: 87396, #regions: 4062806, sequence max length: 15
using split 1
/home/sujing/workspace/torch/install/bin/luajit: ...g/workspace/torch/install/share/lua/5.1/nn/Container.lua:67:
In 3 module of nn.Sequential:
...sujing/workspace/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #8 to 'v' (cannot convert 'nil' to 'int64_t')
stack traceback:
[C]: in function 'v'
...sujing/workspace/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'ClassNLLCriterion_updateOutput'
...ace/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:41: in function 'updateOutput'
./densecap/modules/OurCrossEntropyCriterion.lua:19: in function 'forward'
./densecap/LocalizationLayer.lua:466: in function 'f'
./densecap/LocalizationLayer.lua:228: in function 'timeit'
./densecap/LocalizationLayer.lua:455: in function <./densecap/LocalizationLayer.lua:383>
[C]: in function 'xpcall'
...g/workspace/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
.../workspace/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
./densecap/DenseCapModel.lua:253: in function 'forward'
./densecap/DenseCapModel.lua:406: in function 'forward_backward'
./eval/eval_utils.lua:58: in function 'eval_split'
evaluate_model.lua:63: in main chunk
[C]: in function 'dofile'
...pace/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

@xiangyangli-cn
Copy link

I have the same problem. How to fix it?

@xiangyangli-cn
Copy link

I have solved it. I have trained a new model, and the new one works well.

@doiken23
Copy link

Could you reproduce the score of the original Densecap parper? I have the same problem and consider to train a new model from scratch.

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