-
-
Save melonkernel/f41940c4c408a91336054c5c2eb8c399 to your computer and use it in GitHub Desktop.
Debugging fastai on m1
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
from fastai.vision.all import * | |
from nbdev.showdoc import * | |
set_seed(2) | |
bs = 64 | |
path = untar_data(URLs.PETS); | |
Path.BASE_PATH = path # display all paths relative to dataset root | |
path_anno = path/'annotations' | |
path_img = path/'images' | |
fnames = get_image_files(path_img) | |
dls = ImageDataLoaders.from_name_re( | |
path, fnames, pat=r'(.+)_\d+.jpg$', item_tfms=Resize(460), bs=bs, | |
batch_tfms=[*aug_transforms(size=224, min_scale=0.75), Normalize.from_stats(*imagenet_stats)]) | |
print(dls.vocab) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment