yunjey/mnist-svhn-transfer

Dataloader error.

ILYSHI opened this issue · 3 comments

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

did you resolve it?

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.

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