Fastai on Apple M1

Local virtualenv, like this:

python -m venv venv
source venv/bin/activate

pip install -U pip wheel setuptools
pip install -r requirements.txt

Thanks for your helpful reply.
I have tried this and yes - it does indeed make a build. In a Python env.

However, learn = cnn_learner(dls, resnet18, metrics=error_rate)

… kills the kernal. I have tried multiple times.

Configuration is: Sonoma Macbook Pro Max M2.

So - guess have to wait until something improves with the FastAi distro.

I believe FastAI is incompatible with Pytorch versions above 1.13. I havent used FastAI recently, so my input may not be relevant.

1 Like

yes - it is pretty clear to me now. thanks for the reply.

I know Jeremy is a Windows guy (not that there is any wrong with that …LOL)

Really need to get Fast AI working well on M1/2 Apple Silicon.
Lots of people do ML on this platform.

‘cnn_learner’ is deprecated. Have you tried ‘vision_learner’ ?

it is irrespective. tried each method.
it is ok - if M1/2 is a priority it will get updated.
until then - just review FastAi but use Pytorch Independently on Apple silicon.

I managed to get both my M2 Mac Book air and M1 Mac Mini to run the chapter1 code with instructions from this address:

with one exception, instead of the overnight channel, I used the pytorch channel to install. M1 is much slower than M2, about 10x. But M2 is quiet decent.

conda install pytorch torchvision torchaudio -c pytorch
1 Like

What do you mean it’s compatible?

05_pet_breeeds.ipynb and 07_sizing_and_tta.ipynb still throws:
`The operator ‘aten::_linalg_solve_ex.result’ is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on https://github.com/pytorch/pytorch/issues/77764.

06_multicat.ipynb throws: TypeError: no implementation found for ‘torch.nn.functional.binary_cross_entropy_with_logits’ on types that implement torch_function: [<class ‘fastai.torch_core.TensorImage’>, <class ‘fastai.torch_core.TensorMultiCategory’>

This is the one I tried