Giter Club home page Giter Club logo

Comments (10)

iamaaditya avatar iamaaditya commented on August 31, 2024 1

Issue is because Spacy updated the pretrained word embeddings model. Do the following to fix the issue.

  1. On the terminal

python -m spacy download en_vectors_web_lg

  1. In the code (demo.py), change the line
 word_embeddings = spacy.load('en', vectors='en_glove_cc_300_1m_vectors')

to

 word_embeddings = spacy.load('en_vectors_web_lg')

from vqa_demo.

zzzhacker avatar zzzhacker commented on August 31, 2024

I have same issue

from vqa_demo.

akshaybhatia10 avatar akshaybhatia10 commented on August 31, 2024

Yes, the problem is that for each token, spacy is returning a 384 dim vector instead of 300. One quick fix is to take first 300 values only like - question_tensor[0,j,:] = tokens[j].vector[:300] since the VQA model takes a 300 length vector as word_feature_size.

from vqa_demo.

anurgsrivastava avatar anurgsrivastava commented on August 31, 2024

I'm getting this error is I reduce the size.

UserWarning: Trying to unpickle estimator LabelEncoder from version pre-0.18 when using version 0.19.1. This might lead to breaking code or invalid results. Use at your own risk.

Does anyone know what this is? Urgent help needed

from vqa_demo.

michalvavrecka avatar michalvavrecka commented on August 31, 2024

I solved the same issue with the vector dimension and also the userwarning dedicated to newer scikit version (it is neccessary to replicke the file with joblib.dump).
After these changes I am not able to replicate your results while downloading pretrained models. The test image and question gives best answer as "30 % - electricity"instead of train. All what questions result in number answer, Where questions result in yes/no answer.
Can you tell me, whether the dimension reduction should result in such a distortion?

from vqa_demo.

anurgsrivastava avatar anurgsrivastava commented on August 31, 2024

Yes it will. How do we fix this? Can anyone please help. Why is the vector size 384 when it should be 300?

from vqa_demo.

anurgsrivastava avatar anurgsrivastava commented on August 31, 2024

I tried the following

word_embedding = spacy.load('en', vectors = 'en_glove_cc_300_1m_vectors')
tokens = word_embedding(question)
word_embeddings = word_embedding.vocab.vectors.resize((1000000, 300))
question_tensor = np.zeros((1, 30, 300))
for j in range(len(tokens)):
    question_tensor[0,j,:] = tokens[j].vector
return question_tensor

Even after resizing the vectors, the error is removed but it is giving wrong answers. No idea what to do :/ I tried really hard but couldn't find anything online too.

from vqa_demo.

iamaaditya avatar iamaaditya commented on August 31, 2024

from vqa_demo.

anurgsrivastava avatar anurgsrivastava commented on August 31, 2024

I'm using the following versions

Keras = 2.0.5
Tensorflow = 1.2.0

from vqa_demo.

Ravikiran2611 avatar Ravikiran2611 commented on August 31, 2024

when is execute the following
model = gensim.models.KeyedVectors.load_word2vec_format('./data/GoogleNews-vectors-negative300.bin.gz', binary=True)`
i get an error saying
ValueError: could not broadcast input array from shape (75) into shape (300)

can anyone help me
Thanks In advance!!!!!!!!!!!!

from vqa_demo.

Related Issues (20)

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.