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

Could you show your code on Tiny-ImageNet dataset? #7

Open
KululuMi opened this issue Apr 23, 2022 · 5 comments
Open

Could you show your code on Tiny-ImageNet dataset? #7

KululuMi opened this issue Apr 23, 2022 · 5 comments

Comments

@KululuMi
Copy link

Hello, I'm very surprised to see your work, which is simple but effective. However, when I coded your method on tiny-imagenet dataset, I met some trouble, the robust acc and natural acc always 0.01. So could you show your code on Tiny-ImageNet dataset? Thanks a lot.

@jiequancui
Copy link
Collaborator

Hi, thanks for your question.

You may need to set a smaller learning rate for tiny-imagenet.

@KululuMi
Copy link
Author

Thank you! By the way, I set lr=0.1, batch size m = 128, and number of training epochs 100 with transition epochs {75, 90} on the training dataset. And here is my transforms:
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
])
transform_test = transforms.Compose([
transforms.Resize(32),
transforms.ToTensor(),
])
Could you tell me which hyper-parameters need to be modified?

@jiequancui
Copy link
Collaborator

jiequancui commented Apr 24, 2022

Hi,

(1) for transformations,
train_dataset = datasets.ImageFolder(
traindir,
transforms.Compose([
transforms.Resize(32),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
]))

test_loader = torch.utils.data.DataLoader(
datasets.ImageFolder(valdir, transforms.Compose([
transforms.Resize(32),
transforms.ToTensor(),
])),
batch_size=args.batch_size, shuffle=False,
num_workers=4, pin_memory=True)

(2) we use WideResNet-34-10 and the teacher model WideResNet-34-10.

Other hyper-parameters keep the same with CIFAR. You can have a try with this setting. We can talk about it further if it still can not work well.

@KululuMi
Copy link
Author

@jiequancui Thanks for your help, but I have followed your transformations and teacher model setting, and robust/clean acc still is 0.01 when epoch =21. My torch==1.9.0, is there anything else I can do?

@jiequancui
Copy link
Collaborator

Hi,

Let me check it.

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

2 participants