Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size mismatch problem in the impl. #1

Open
FalconLK opened this issue Jul 4, 2020 · 0 comments
Open

Size mismatch problem in the impl. #1

FalconLK opened this issue Jul 4, 2020 · 0 comments

Comments

@FalconLK
Copy link

FalconLK commented Jul 4, 2020

Hi,

Thanks for sharing the nice repo! I'm pretty interested in the work.

However, there is a size mismatch error when I run the code as is after downloading and processing the data.

Could you please kindly answer a few of my questions ? :)

  1. Is there a specific condition to run this? Please give me an example command so that I can use as is (when we assume the dataset(pkl) is generated)?

  2. Also, the parameter "processed_dir" = 'O:/dataset/vae_cf/data/ml-20m/pro_sg' is it correct? Cause your dataset.py doesn't generate the pkl to that path. The original ml-20m/ dir is under the root of the project.

File "demo.py", line 149, in main
    trainer.train()
  File ".../variational-autoencoders-for-collaborative-filtering-pytorch/trainer.py", line 189, in train
    self.train_epoch()
  File ".../variational-autoencoders-for-collaborative-filtering-pytorch/trainer.py", line 155, in train_epoch
    logits, KL, mu_q, std_q, epsilon, sampled_z = self.model.forward(data_tr, prof)
  File ".../variational-autoencoders-for-collaborative-filtering-pytorch/vae.py", line 79, in forward
    mu_q, logvar_q = self.encoder.forward(x)
  File ".../variational-autoencoders-for-collaborative-filtering-pytorch/vae.py", line 31, in forward
    x = self.linear_1(x)
  File ".../anaconda3/envs/pytorch_env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File ".../anaconda3/envs/pytorch_env/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 87, in forward
    return F.linear(input, self.weight, self.bias)
  File ".../anaconda3/envs/pytorch_env/lib/python3.8/site-packages/torch/nn/functional.py", line 1610, in linear
    ret = torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, **m1: [1 x 20108], m2: [1 x 600]** at /Users/distiller/project/conda/conda-bld/pytorch_1591914893314/work/aten/src/TH/generic/THTensorMath.cpp:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant