Fastai installation on MAC OS 10.13 CPU only

Hello,

I do my work mostly with Tensorflow and Python 3.6.

As Jeremy suggest that PyTorch is really good for researchers, I wanted to to try it out with the standard install as roposed on the github URL https://github.com/fastai/fastai

I did the following steps

git clone https://github.com/fastai/fastai.git
cd fastai
conda env update -f environment-cpu.yml

this last step gives me the error

Using Anaconda API: https://api.anaconda.org
Fetching package metadata …
Solving package specifications:
NoPackagesFoundError: Dependency missing in current osx-64 channels:

  • pytorch >=0.2.0 -> mkl >=2018

Can anybody help here. I thought that pytorch will be part of the installation
Thanks for helping

Peter

Yes, but because the pytorch installation for Linux and OSX are different, Jeremy might not have added it in the environment file. You could install it directly via the instructions here - http://pytorch.org/

Fast.ai models are written assuming you have a GPU and lots of RAM (32 or 16+ GB?) These are not pre-requisites to give a test run, but running DL on CPU could be very frustrating . You might want to spin up machine in Paperspace or use Google CoLab (that provides free 12 hour GPU). There are other threads that go into detail on running them in those environments.

Hi Ramesh,

thanks for your input. I will try this path of separate install of pytorch.

In the past, I was able to do pretty much any DL with my CPU only (though lots of RAM) and it was kind of slow, but still doable. I will give it a try, then maybe I go Paperspace or build my own box

thanks again
Peter

Hi Peter,

Were you able to solve the problem in MAC?

I am facing a similar problem while trying to install fastai in MAC (CPU only).

Kind regards and many thanks in advance

I was able to get the no-gpu/cpu only version working using the provided environment-cpu.yml file.

I have a 2017 Macbook Pro w/3.1 GHz i7, 16GB of RAM, and 500GB SSD. Running lesson 1 took about an hour on my machine - with no other processes running.

Not sure how other lessons will compare, but 1 hour for CPU only versus a few seconds for GPU (as shown in the lesson video) isn’t a good tradeoff.

If you value your time, I recommend using one of the recommended deep learning GPU capable providers.

On mac os10.15.4 tried pip3 install fastai which hit trouble with bottleneck, so after some fiddling, pip3 install bottleneck ran and I tried again this time successfully. I can import the fastai module from scripts, but for some reason when trying this in pycharm complains that fastai is not a module - I can work without the IDE but wonder if there’s a workaround.

Also I note in passing that the notebook for the nlp lesson4 is actually in the lesson3 materials list.

=== Software ===
python : 3.7.6
fastai : 1.0.61
fastprogress : 0.2.3
torch : 1.4.0
torch cuda : None / is Not available

Hi Jeremy how did you get `pip3 install bottleneck’ to run? I am having the same error

In my case this was ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly. I updated xcode, installed gcc, rebooted, and at that point was able to install.