OctoberChang / klcpd_code

Kernel Change-point Detection with Auxiliary Deep Generative Models (ICLR 2019 paper)
BSD 3-Clause "New" or "Revised" License
58 stars 13 forks source link

Getting errors in running the code with python3 #3

Open stilllearningsoumya opened 2 years ago

stilllearningsoumya commented 2 years ago

While running the code in python3 environment, I am getting this error -- RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]).

Any help in this regard will be highly appreciated. Thanks in advance.

dars16 commented 2 years ago

Thanks to https://github.com/jalola/improved-wgan-pytorch/issues/11#issuecomment-545126457, the solution is to replace line 185 in klcpd.py with one = torch.tensor(1, dtype=torch.float)