rixwew / pytorch-fm

Factorization Machine models in PyTorch
MIT License
1.03k stars 225 forks source link

ValueError: Target and input must have the same number of elements. #9

Closed p-null closed 5 years ago

p-null commented 5 years ago

Hi, When nfm is used as model, the return value (batch_size, batch_size) does not have the right shape. This will cause a error when calculating the loss.

rixwew commented 5 years ago

I reproduced same error and released a quick fix patch. https://github.com/rixwew/pytorch-fm/commit/b75ea00637957d0881fa0db49068b02ca720b0f6 Thank you. @tingkai-zhang

Drone-Banks commented 5 years ago

@rixwew same problem in FNFM model

rixwew commented 5 years ago

@Drone-Banks thank you for a bug report! I fixed in https://github.com/rixwew/pytorch-fm/commit/dd5aa6d5743b59224d457e77e85154da33ee2a5a, and updated pypi package.

p-null commented 5 years ago

Thanks!