Hi All,
Here is a step-by-step guide to set up FastAI on your Windows 11 Machine using WSL.
Step 1: First and foremost you need to enable WSL on your windows machine following the below process:
- The easiest way is to open your
Powershell
in admin mode and type this commandwsl --install
In most cases, this should work, but I have seen few cases where this didn’t work due to the internet provider blocking the configuration file that is needed for the above command.
- If the above option didn’t work for you then you might need to follow the manual install process following this official guide
Step 2: Installing Python using Mambaforge
I highly recommend you first watch this walk-through session from Jeremy before you continue with the other steps.
- Download Mamba forge from the Github repo using this link and install by following Jeremy’s guide from the above video.
Step 3: Install Pytorch
In order to utilize our GPU properly we need to install a host of other libraries so that FastAI works seamlessly.
-
Install PyTorch by following the official documentation
-
At the time of writing this guide FastAI & Pytorch worked seamlessly with PyTorch v1.12.0. So for now you could use this command if you have GPU installed
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.6 -c pytorch -c conda-forge
Step 4 Install FastAI
Again, please follow FastAI’s official documentation here but at the time of writing this guide the command was conda install -c fastchan fastai
Step 5 Install JupyterLab
And the last step is to install Jupyter Lab using the command conda install jupyterlab
Notes:
-
Just to keep it consistent I have used
conda
solver for this tutorial but you could just replaceconda
withmamba
they both work interchangeably. -
If you install Pytorch > v1.12.0 then sometimes Vision Learner may not work properly, if that is the case (it was for me) then you need to add this code
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
to your.bashrc
file and restart WSL - here is a link if you need more details.
Please let me know if I missed anything to include here or if you have any better ideas to share.