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

Problem when I run /PATE/SHVN/Main.py #1

Open
Huangpq2019 opened this issue Jul 12, 2019 · 2 comments
Open

Problem when I run /PATE/SHVN/Main.py #1

Huangpq2019 opened this issue Jul 12, 2019 · 2 comments

Comments

@Huangpq2019
Copy link

$ python Main.py
Using downloaded and verified file: ../data/train_32x32.mat
Using downloaded and verified file: ../data/test_32x32.mat
TRAINING model_0
EPOCH: 1
Traceback (most recent call last):
File "Main.py", line 35, in
teacher.train(train_loader)
File "/home/liujj/PATE/SHVN/Teacher.py", line 116, in train
self.loop_body(split[index],model_name,1)
File "/home/liujj/PATE/SHVN/Teacher.py", line 129, in loop_body
output = model(data)
File "/mnt/data/conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/liujj/PATE/SHVN/Model.py", line 18, in forward
x = F.relu(self.conv1(x))
File "/mnt/data/conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/mnt/data/conda/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 338, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size 20 1 5 5, expected input[64, 3, 32, 32] to have 1 channels, but got 3 channels instead

what is the RuntimeError mean? Can you help me solve?

@kamathhrishi
Copy link
Owner

@Huangpq2019 Thank you for raising the issue. I haven't completed the pate example yet :) . This reason for this issue is simple. I have used the same lenet model for shvn which is incorrect since mnist is 28×28 images and mnist is 32×32 images so dimensions mismatch occurs. I would like to proceed to complete this project end of this month. In next 24-48 hours I will try fixing this issue.

@jahidhasanlinix
Copy link

May I know when I run this code, do I need any kind of dataset to work with? I actually can't see any datasets available in the repo, that's why asking.

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