Skip to content

Instantly share code, notes, and snippets.

@dansuh17
Created February 15, 2018 06:23
Show Gist options
  • Save dansuh17/7d6190985444cb107a61a0586cfdad16 to your computer and use it in GitHub Desktop.
Save dansuh17/7d6190985444cb107a61a0586cfdad16 to your computer and use it in GitHub Desktop.
Dataset creation for pretrained alexnet model in pytorch.
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