Resolving issues with FastAI on Windows 10 Anaconda due to Torch 1.8

On March 4th PyTorch 1.8 was released and I believe this is causing problems for new or updated Anaconda Installs

I personally just purchased the new FastAI book and was going through the latest Course v4 when i noticed my code was not running. Specifically from import * would not execute. This was due to be having am older version from FastAI pre 2.0 installed. I struggled for 4+ hours trying to get it resolved, even giving up and trying colab only to get another similar error.

Finally resolved my issues doing this:

Keep in mind the first action is to uninstall Anaconda so this will remove everything else you ever uninstalled in Anaconda, this is par for the course sometimes trying to do AI, Python work on a PC.

  1. Uninstall Anaconda3 and Reboot
  2. Install Pytorch using Anaconda Prompt (As Admin, right click it and hit more) with conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.2 -c pytorch
  3. Update Pip with: pip install --upgrade pip
  4. Install FastAI with pip install fastai
  5. Install fastbook for the course with: pip install -Uqq fastbook
  6. Install graphwiz with: pip install graphviz

The main fix is installing pytorch 1.7.1 which is looks like everything is now defaulting to 1.8 which I believe caused my issues. It’s possible one could uninstall Pytorch, FastAI, etc and just start at that point. Running the Conda installs resulted it going through some complex environment handling ultimately failing each time after wasting 30 minutes on each attempt. pip looks to be much cleaner.

Hopefully this helps at least 1 other person!

1 Like

Thanks, at least for me, it worked with one note:
I had to change “pip install -Uqq fastbook”
“pip install -Uqq fastbook --user”
no need to reinstall everything just a new environment have solved the problem.