Giter VIP home page Giter VIP logo

Comments (21)

abhshkdz avatar abhshkdz commented on June 5, 2024

Weird. Can you please paste the complete error message and directory structure (especially of the data folder) here?

from neural-vqa.

1byxero avatar 1byxero commented on June 5, 2024

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.

1byxero avatar 1byxero commented on June 5, 2024

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.

abhshkdz avatar abhshkdz commented on June 5, 2024

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.

1byxero avatar 1byxero commented on June 5, 2024

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.

abhshkdz avatar abhshkdz commented on June 5, 2024

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.

abhshkdz avatar abhshkdz commented on June 5, 2024

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.

1byxero avatar 1byxero commented on June 5, 2024

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.

abhshkdz avatar abhshkdz commented on June 5, 2024

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.

1byxero avatar 1byxero commented on June 5, 2024

That will be very helpful of you.

from neural-vqa.

abhshkdz avatar abhshkdz commented on June 5, 2024

The CPU checkpoint can be downloaded from here. Let me know if you run into any other issues.

from neural-vqa.

abhshkdz avatar abhshkdz commented on June 5, 2024

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.

1byxero avatar 1byxero commented on June 5, 2024

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.

abhshkdz avatar abhshkdz commented on June 5, 2024

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.

1byxero avatar 1byxero commented on June 5, 2024

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.

abhshkdz avatar abhshkdz commented on June 5, 2024

Argh, I see. Thanks for confirming. Fixing.

from neural-vqa.

abhshkdz avatar abhshkdz commented on June 5, 2024

Cast everything to double() and tested. Download it from here. Let me know if this works.

from neural-vqa.

1byxero avatar 1byxero commented on June 5, 2024

Link throws 404

from neural-vqa.

abhshkdz avatar abhshkdz commented on June 5, 2024

https://dl.dropboxusercontent.com/u/19398876/neural-vqa/emb512_epoch23.26_0.4610_cpu.t7

from neural-vqa.

1byxero avatar 1byxero commented on June 5, 2024

Cool, I'll download it and let you know
Thanks.

from neural-vqa.

1byxero avatar 1byxero commented on June 5, 2024

Its working

from neural-vqa.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.