I’m starting the fastai course and I thought it would be nice to be in control of the hardware needed to run the notebooks. I tried using Google’s colab and it’s quite cumbersome and slow and I have some experience with the nano platform so I thought I might give it a try.
I know @Interogativ posted here some instructions for setting it up
However the instructions are quite old and accordingly the version of pytorch and fastai are old.
I opted instead to base my setup on the more recent jetcard setup - an SD card image which includes jupyter and pytorch,
I installed fastai on top of it (just pip3 install fastai
) and I can import fastai.
However, the first notebook from the course does not run.
In particular, the first cats example gives me an error:
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 = cnn_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)
I tried running it in a standalone file and I’m getting a similar result to what I’m getting in the notebook:
Could not do one pass in your dataloader, there is something wrong in it
Then the standalone version core-dumps:
Illegal instruction (core dumped)
No additional information is available, either in the standalone script or in the jupyter notebook.
I assume such a cheap standalone setup would be useful to others. If I could only get this to work…
My installed packages are:
% pip3 freeze | grep -E 'torch|fastai'
efficientnet-pytorch==0.6.3
fastai==2.4
segmentation-models-pytorch==0.1.3
torch==1.9.0
torch2trt==0.2.0
torchvision==0.10.0
Ideas for how to proceed would be welcome