Created
February 15, 2018 06:23
-
-
Save dansuh17/7d6190985444cb107a61a0586cfdad16 to your computer and use it in GitHub Desktop.
Dataset creation for pretrained alexnet model in pytorch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = 'imagenet' | |
traindir = 'train' | |
image_dataset = ImageFolder( | |
traindir, | |
transform=transforms.Compose([ | |
transforms.RandomResizedCrop(224), | |
transforms.RandomHorizontalFlip(), | |
transforms.ToTensor(), | |
transforms.Normalize(mean=[0.485, 0.456, 0.406], | |
std=[0.229, 0.224, 0.225]), | |
]) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment