fastwolf
(fastwolf)
December 26, 2022, 2:39am
1
I ran this block of code on Colab from the Book(01_intro.ipynb)
from fastai.vision.all import *
path = untar_data(URLs.PETS)/'images'
def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
path, get_image_files(path), valid_pct=0.2, seed=42,
label_func=is_cat, item_tfms=Resize(224))
learn = vision_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)
And the line **learn.fine_tune(1)**
, just takes forever. It took 57 mins total to fine-tune (though downloading the dataset and model took less than a min)
Is this normal?
1 Like
AllenK
(Allen Kamp)
December 26, 2022, 8:05am
2
It sounds like the GPU has not been selected.
To select it.
From the colab top menu, select “Runtime” then “Change runtime type” and select GPU as the hardware accelerator, and save.
Then re-run the notebook.
8 Likes
fastwolf
(fastwolf)
December 26, 2022, 8:30am
3
Thanks @AllenK !
Yes, the GPU wasn’t selected. I changed the setting(selected GPU) and now it took less than Three minutes, compared to 57 mins!
TY
3 Likes
huy
(huy nguyen)
January 4, 2023, 5:27pm
4
Thanks ! I was wondering what I’ve done wrong.
1 Like