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

How to reproduce the results on CIFAR10 #1

Open
zhangshuaitao opened this issue Aug 27, 2020 · 4 comments
Open

How to reproduce the results on CIFAR10 #1

zhangshuaitao opened this issue Aug 27, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@zhangshuaitao
Copy link

How to reproduce the results on cifar10, I downloaded the net.config and net.init files of cifar10 in the table, and ran the valid script, but only got top1=10.

@zhangshuaitao
Copy link
Author

@mikelzc1990

@mikelzc1990
Copy link
Owner

mikelzc1990 commented Aug 27, 2020

There's an inconsistency between search dataloader and validation dataloader, please use the following commend as a quick hack for now. You will also need to comment this line.

I'm traveling right now, will update the code with a proper fix next week.

python train_cifar.py --data /mnt/datastore/CIFAR/ --dataset cifar10 --evaluate --model-config ../net.config --initial-checkpoint ../net.init

@mikelzc1990 mikelzc1990 self-assigned this Aug 27, 2020
@mikelzc1990 mikelzc1990 added the bug Something isn't working label Aug 27, 2020
@zhangshuaitao
Copy link
Author

@mikelzc1990, I have fixed the bug that the pre-trained model is not loaded in the code, and got Acc@1 97.7 by using net.config and net.init in net-flops@468. I guess that the current net.init is the weight obtained during the network search. I need to use train_cifar.py to fine-tune on cifar10 to get the Acc@1 98.4 reported in the paper. Is that true?

@AwesomeLemon
Copy link

The code seems to have not been updated to fix this. The main problem is not loading the pretrained weights (thanks @zhangshuaitao for mentioning that), which can be fixed by adding the following 2 lines to validation.py here (https://github.com/mikelzc1990/nsganetv2/blob/0e68ac3a4f/validation.py#L76)

    init = torch.load(args.pretrained, map_location='cpu')['state_dict']
    model.load_state_dict(init)

@vinh-cao vinh-cao mentioned this issue Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants