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

Issue with the scoring net part of D3VAE's PyTorch code #308

Closed
Paandaman opened this issue Jan 26, 2023 · 1 comment
Closed

Issue with the scoring net part of D3VAE's PyTorch code #308

Paandaman opened this issue Jan 26, 2023 · 1 comment

Comments

@Paandaman
Copy link

First of all, thank you for your interesting work and for releasing the code on github!

I ran into an issue when I tried to reproduce the paper's results on the ETTh1 dataset. The issue is related to the line below:

output = output.view(-1, int(self.hw/8)*int(self.hw/8)*8*self.dim)

or one of the previos steps, since it only seems to work with evenly numbered batch sizes.

To reproduce, with a fresh clone of the repository, run https://github.com/PaddlePaddle/PaddleSpatial/blob/main/research/D3VAE/d3vae_pytorch/main.py
with all arguments set to default except for the path to the dataset, the batch_size and optionally specify which gpu to use. If run with an even integer as batch_size it works:
python main.py --root_path /path/to/ETDataset/ETT-small/ --data_path ETTh1.csv --batch_size 2 --gpu 0
but if the batch_size is uneven, e.g. 1, the code crashes with the following error:
PaddleSpatial/research/D3VAE/d3vae_pytorch/model/resnet.py", line 152, in forward output = output.view(-1, int(self.hw/8)*int(self.hw/8)*8*self.dim) RuntimeError: shape '[-1, 8192]' is invalid for input of size

@yl4467
Copy link

yl4467 commented Jan 28, 2023

Hi,
Since here we use the resnet (line 54 in 'model.py') with fixed parameters and structure to calculate the score, so the batch size needs to be set to an even number to adapt to this network.

If the batch size is set to an uneven number, the structure of the resnet needs to be modified as well.

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

3 participants