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

Dataloader error. #8

Open
ILYSHI opened this issue Jun 23, 2021 · 3 comments
Open

Dataloader error. #8

ILYSHI opened this issue Jun 23, 2021 · 3 comments

Comments

@ILYSHI
Copy link

ILYSHI commented Jun 23, 2021

After running model:
RuntimeError: output with shape [1, 32, 32] doesn't match the broadcast shape [3, 32, 32]

@DerrickWanglf
Copy link

did you resolve it?

@Allenem
Copy link

Allenem commented Feb 5, 2024

I fixed it by doing like this in the data_loader.py:

    transform3 = transforms.Compose([
                    transforms.Resize(config.image_size),
                    transforms.ToTensor(),
                    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
    
    transform1 = transforms.Compose([
                    transforms.Resize(config.image_size),
                    transforms.ToTensor(),
                    transforms.Normalize((0.5, ), (0.5, ))])
    
    svhn = datasets.SVHN(root=config.svhn_path, download=True, transform=transform3)
    mnist = datasets.MNIST(root=config.mnist_path, download=True, transform=transform1)

Besides, there are also some other bugs you need to fix. Finally, fortunately, I have run this code.

@surya-narayanan
Copy link

Were you able to get a clean domain adaptation? We found that the numbers were not paired.

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

4 participants