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

expanded_attrs = attrs.view(*attrs.shape, 1, 1).expand(*attrs.shape, w, h) seems to be a problem #3

Open
SoEzreal opened this issue Jan 11, 2022 · 1 comment

Comments

@SoEzreal
Copy link

    if self.n_attrs:
        batch_size, c, w, h = x.shape
        expanded_attrs = attrs.view(
            *attrs.shape, 1, 1).expand(*attrs.shape, w, h)
        x = torch.cat((x, expanded_attrs), dim=1)

x = torch.cat((x, expanded_attrs), dim=1)
RuntimeError: Tensors must have same number of dimensions: got 4 and 6


Hello, when I run this program (VAEGAN), these sentences of code will have problems. The original data is 4-dimensional, and the torch cannot be executed after dimension upgrading or expansion torch.cat operation

@SoEzreal
Copy link
Author

(img, attrs) in enumerate(data_loader)

Because I'm trying to run vaegan on the cifar-10 dataset. In fact, I don't know what “img” and “attrs” from each batch of CELEBA dataset look like.

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