Comments (21)
Weird. Can you please paste the complete error message and directory structure (especially of the data
folder) here?
from neural-vqa.
contents of data folder are
Annotations_Train_mscoco.zip
Annotations_Val_mscoco.zip
answers_vocab.t7
data.t7
download_data.sh
mscoco_train2014_annotations.json
mscoco_val2014_annotations.json
MultipleChoice_mscoco_train2014_questions.json
MultipleChoice_mscoco_val2014_questions.json
OpenEnded_mscoco_train2014_questions.json
OpenEnded_mscoco_val2014_questions.json
Questions_Train_mscoco.zip
Questions_Val_mscoco.zip
questions_vocab.t7
read.py
temp(folder containing my download scripts)
train2014(folder containing images)
val2014(folder containing images)
vqa_epoch15.00_0.4576.t7
and the error traceback is
path_to_torch/install/bin/lua: extract_fc7.lua:119: bad argument #3 to 'narrow' (out of range at path_torch/pkg/torch/lib/TH/generic/THTensor.c:351)
stack traceback:
[C]: in function 'narrow'
extract_fc7.lua:119: in main chunk
[C]: in function 'dofile'
.../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: ?
from neural-vqa.
I encountered another issue before whose reason was not having the complete dataset,
I actually have downloaded about 250 validation images and 250 training images
and since not all images are there I have edited extract_f7.lua to ignore the files which are not on my storage.
I thought I should mention this so that this may help you figure out the issue!
from neural-vqa.
Yep, that's why it's happening. image_id
gets populated from loader.data
, and the loop repeats till idx >= #image_id
. You might want to go ahead and use the extracted fc7 features if you don't want to download the whole image dataset.
from neural-vqa.
You mean extracted fc7 features are actually the result of all the 250 images and i can use them for prediction?
If no, will you please tell me how to extract the image features on the data that i already have?
thank you!
from neural-vqa.
Extracted fc7 features are for the entire MSCOCO train set (82784 images), and yes, you can use them for training. For predicting, take a look at predict.lua.
from neural-vqa.
To get an idea of how things work, and to at least get the model to make predictions, I'd suggest you first download the pretrained model, and use it to run predict.lua
as per instructions given in readme.
from neural-vqa.
So those 4 files would do the trick right?
I'm having another issue,
Which throws "unknown Torch class <torch.CudaTensor>" error when using predict.lua
which I guess is caused becuase the pretrained models are trained using a GPU-CPU machine and mine is CPU only machine, is there any quick way to get these pretrained models to work on my machine?
or maybe can you please add cpu trained checkpoint file to the repo?
from neural-vqa.
Right, I'm kinda busy right now but I'll write a script to convert the model snapshots to CPU as soon as possible and probably even upload CPU checkpoints and vocab tensors. Unfortunately, simply calling :float()
on the model wouldn't work.
from neural-vqa.
That will be very helpful of you.
from neural-vqa.
The CPU checkpoint can be downloaded from here. Let me know if you run into any other issues.
from neural-vqa.
I've fixed a minor related bug, tested the prediction code on CPU and added checkpoint links (GPU & CPU) to the readme as well. It should work fine now.
from neural-vqa.
Thanks for the cpu checkpoints, but now those checkpoint run me into another error,
which is
path_to_torch/install/bin/lua: ...path_to_torch/install/share/lua/5.1/nn/Linear.lua:55: invalid arguments: DoubleTensor number DoubleTensor number FloatTensor DoubleTensor
expected arguments: *DoubleTensor~2D* [DoubleTensor~2D] [double] DoubleTensor~2D DoubleTensor~2D | *DoubleTensor~2D* double [DoubleTensor~2D] double DoubleTensor~2D DoubleTensor~2D
stack traceback:
[C]: in function 'addmm'
...path_to_torch/install/share/lua/5.1/nn/Linear.lua:55: in function <...path_to_torch/install/share/lua/5.1/nn/Linear.lua:39>
(tail call): ?
...path_to_torch/install/share/lua/5.1/nngraph/gmodule.lua:275: in function 'neteval'
...path_to_torch/install/share/lua/5.1/nngraph/gmodule.lua:310: in function <...path_to_torch//install/share/lua/5.1/nngraph/gmodule.lua:230>
(tail call): ?
(tail call): ?
predict.lua:159: in function 'predict'
predict.lua:173: in main chunk
[C]: in function 'dofile'
.../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: ?
and I looked up the error and found out this.
quematech encountered the same error and karpathy solved it with this commit
from neural-vqa.
I am pretty sure I fixed this one. Can you pull in the latest changes and try once with the CPU checkpoint link given at the bottom of the readme?
from neural-vqa.
I actually tried doing it with old repo, and the error was different which was something related to
thmathtensor
So i pulled the updates and the cpu checkpoints too,
but encountered above error
I updated the links in this comment so that it'll be easy for you to locate the answer. :-)
from neural-vqa.
Argh, I see. Thanks for confirming. Fixing.
from neural-vqa.
Cast everything to double()
and tested. Download it from here. Let me know if this works.
from neural-vqa.
Link throws 404
from neural-vqa.
https://dl.dropboxusercontent.com/u/19398876/neural-vqa/emb512_epoch23.26_0.4610_cpu.t7
from neural-vqa.
Cool, I'll download it and let you know
Thanks.
from neural-vqa.
Its working
from neural-vqa.
Related Issues (15)
- Provided checkpoint file cannot be used. HOT 6
- not enough memory HOT 10
- LookupTable.lua:75: bad argument #3 to 'index' (Tensor | LongTensor expected, got torch.CudaLongTensor) HOT 3
- should this directory works well?
- what 's means about "not found: .......THNN.lua:108: NYI: call arg type " ? HOT 4
- Error while evaluating through pretrained checkpoint HOT 23
- cannot open <data/MultipleChoice_mscoco_train2014_questions.json> in mode r at /home/hadjer/torch/pkg/torch/lib/TH/THDiskFile.c:673 stack traceback: [C]: ? [C]: in function 'DiskFile' ./utils/DataLoader.lua:234: in function 'json_to_tensor' ./utils/DataLoader.lua:43: in function 'create' extract_fc7.lua:47: in main chunk [C]: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk HOT 2
- 2vis-lstm
- work issue
- Performance on VQA test set HOT 3
- modify the code to do image caption HOT 2
- Error ---- predict.lua -checkpoint_file vqa_epoch15.00_0.4576.t7 -input_image_path data/train2014/COCO_train2014_000000405541.jpg -question 'What is the cat on?' HOT 7
- cutorch not necessary for extracting image features on CPU HOT 1
- Performance and memory issue with training HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neural-vqa.