xiaolai-sqlai / mobilenetv3

mobilenetv3 with pytorch,provide pre-train model
MIT License
1.6k stars 340 forks source link

Validation accuracy for mobilenetv3_small #5

Open sjzhuo opened 5 years ago

sjzhuo commented 5 years ago

I downloaded the small model and tested it, but only got accuracy 64.926%. Not sure is it because of preprocessing difference? Here is what I used:

normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                     std=[0.229, 0.224, 0.225])

val_loader = torch.utils.data.DataLoader(
        datasets.ImageFolder(valdir, transforms.Compose([
            transforms.Resize(256),
            transforms.CenterCrop(224),
            transforms.ToTensor(),
            normalize,
        ])),
        batch_size=128, shuffle=False,
        num_workers=1, pin_memory=True)
aa12356jm commented 5 years ago

load the model will throw some errors, can you show me the codes that how to load the model ?thanks

xiaolai-sqlai commented 5 years ago

I just use the DALI by Nvidia to read the dataset. For validation, I resize the short size to 256 and do center crop. Actually, I think it should be no difference. Maybe I will reproduce the model by dataloader in pytorch.

tilmto commented 5 years ago

I downloaded the small model and tested it, but only got accuracy 64.926%. Not sure is it because of preprocessing difference? Here is what I used:

normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                     std=[0.229, 0.224, 0.225])

val_loader = torch.utils.data.DataLoader(
        datasets.ImageFolder(valdir, transforms.Compose([
            transforms.Resize(256),
            transforms.CenterCrop(224),
            transforms.ToTensor(),
            normalize,
        ])),
        batch_size=128, shuffle=False,
        num_workers=1, pin_memory=True)

Hi, I tried your preprocessing parameters but the accuracy remains very low. Could you share your source code and whole settings for validation? Thanks.