Code Monkey home page Code Monkey logo

Comments (25)

monkeyusage avatar monkeyusage commented on June 12, 2024 13

the same problem~

I had an issue with the embeddings I fixed it initializing the embedding layer with the right size which is the size of the vocabulary I am using.

when creating your Encoder/Model:

self.embed = nn.Embedding(vocab_size, embed_size)
I was using a smaller number than my actual vocab_size thus resulting in an error.

from deepfm_with_pytorch.

anksng avatar anksng commented on June 12, 2024 8

Hi, try to inspect the size of your vocabulary , if using the vocab_size in the Embedding layer initialization, try to add +1 to it like -> self.embed = nn.Embedding(vocab_size+1, embed_size)

from deepfm_with_pytorch.

shantam21 avatar shantam21 commented on June 12, 2024 4

Did anyone get the solution? I'm stuck! just wanted to confirm what vocab_size here means. Does it mean the length of the tokenized words set?

from deepfm_with_pytorch.

shira-g avatar shira-g commented on June 12, 2024 3

It happened to me when I had out-of-vocabulary words which were assigned a -1 value, and also it happens when you set the vocab-size to a smaller value than the size of the vocabulary + 1

from deepfm_with_pytorch.

Guilherme26 avatar Guilherme26 commented on June 12, 2024 1

Hey guys, I had the same problem. In my case, what happened was that I was presenting the Input (X) and the Output (Y) to the model with len(X) != len(Y) due to an error in a third-party library.

Best regards and good luck!

from deepfm_with_pytorch.

anksng avatar anksng commented on June 12, 2024 1

Hi, try to inspect the size of your vocabulary , if using the vocab_size in the Embedding layer initialization, try to add +1 to it like -> self.embed = nn.Embedding(vocab_size+1, embed_size)

Hi, this works. But would you mind providing an explanation for this?

I guess it was a bug, which is now fixed by @chenxijun1029 .
What I remember is that the error is because embedding_dim must be equal to the vocab size, but when initializing the embedding layer with len(voca_size) it somehow subtracts 1.

from deepfm_with_pytorch.

cserken avatar cserken commented on June 12, 2024

hi~
anybody know how to fix this issue?

thanks!

from deepfm_with_pytorch.

leadtoit avatar leadtoit commented on June 12, 2024

the same problem~

from deepfm_with_pytorch.

mojirml avatar mojirml commented on June 12, 2024

the same problem~

from deepfm_with_pytorch.

monkeyusage avatar monkeyusage commented on June 12, 2024

the same problem~

from deepfm_with_pytorch.

ice16 avatar ice16 commented on June 12, 2024

same problem

from deepfm_with_pytorch.

lewisbakkero avatar lewisbakkero commented on June 12, 2024

Same issue when using flair0.4.1, pythorch1.1.0 and BertEmbeddings on 2 x NVIDIA Tesla P100

from deepfm_with_pytorch.

zqs01 avatar zqs01 commented on June 12, 2024

the same problem

from deepfm_with_pytorch.

vinklibrary avatar vinklibrary commented on June 12, 2024

the same problem

from deepfm_with_pytorch.

RyanAmaudruz avatar RyanAmaudruz commented on June 12, 2024

same issue

from deepfm_with_pytorch.

ganyuqi avatar ganyuqi commented on June 12, 2024

hi, is anybody fix the problem?

from deepfm_with_pytorch.

loretoparisi avatar loretoparisi commented on June 12, 2024

we have the same problem using LASER bi-LSTM model with PyTorch 1.0 / Python 3.7
https://github.com/facebookresearch/LASER

from deepfm_with_pytorch.

chenxijun1029 avatar chenxijun1029 commented on June 12, 2024

Sorry for answering so late!
I think I've fixed this bug. The main reason is that I accumulated offset when iterate feature size in data preprocess, so index of categorial feature is out of embedding size. Please refer to the update in dataPreprocess.py.
Also, I've found that I should set the index of coutinous feature as 0, and the value of coutinous feature as its original value instead of 1. Refer to the update of dataset.py for more details.
Thanks for your attention.

from deepfm_with_pytorch.

loretoparisi avatar loretoparisi commented on June 12, 2024

@chenxijun1029 in which version this has been fixed? Thank you.

from deepfm_with_pytorch.

maulberto3 avatar maulberto3 commented on June 12, 2024

the same problem~

I had an issue with the embeddings I fixed it initializing the embedding layer with the right size which is the size of the vocabulary I am using.

when creating your Encoder/Model:

self.embed = nn.Embedding(vocab_size, embed_size)
I was using a smaller number than my actual vocab_size thus resulting in an error.

Hi. I too resolved my issue by fixing what @mcszn suggested.

from deepfm_with_pytorch.

tinaty avatar tinaty commented on June 12, 2024

Hi, try to inspect the size of your vocabulary , if using the vocab_size in the Embedding layer initialization, try to add +1 to it like -> self.embed = nn.Embedding(vocab_size+1, embed_size)

Hi, this works. But would you mind providing an explanation for this?

from deepfm_with_pytorch.

tinaty avatar tinaty commented on June 12, 2024

Hi, try to inspect the size of your vocabulary , if using the vocab_size in the Embedding layer initialization, try to add +1 to it like -> self.embed = nn.Embedding(vocab_size+1, embed_size)

Hi, this works. But would you mind providing an explanation for this?

I guess it was a bug, which is now fixed by @chenxijun1029 .
What I remember is that the error is because embedding_dim must be equal to the vocab size, but when initializing the embedding layer with len(voca_size) it somehow subtracts 1.

got it. thanks very much.

from deepfm_with_pytorch.

lyleshaw avatar lyleshaw commented on June 12, 2024

same issue

from deepfm_with_pytorch.

lu161513 avatar lu161513 commented on June 12, 2024

Hi, try to inspect the size of your vocabulary , if using the vocab_size in the Embedding layer initialization, try to add +1 to it like -> self.embed = nn.Embedding(vocab_size+1, embed_size)

Why +1 will solve the problem,The initialization of embedding should not be used vocab_size rather than vocab_size+1?

from deepfm_with_pytorch.

onlyhebo avatar onlyhebo commented on June 12, 2024

I have the same issue. See DeepFM_with_PyTorch/data/dataset.py Row7 : continous_features = 13.
Change the value for your dataset. You can have a correct result.

from deepfm_with_pytorch.

Related Issues (9)

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.