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 fastai.vision.all 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.
- Uninstall Anaconda3 and Reboot
- 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
- Update Pip with:
pip install --upgrade pip
- Install FastAI with
pip install fastai
- Install fastbook for the course with:
pip install -Uqq fastbook
- 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!