I can second this fix. Works for me now. Running Ubuntu 18.04.
Had the same problem after using the guide for Google Cloud https://course.fast.ai/start_gcp
The above solution by @heraldb didn’t work for me as it tried to downgrade to fastai 1.0 for me.
I ended up making it work by creating a new conda environment using fastbook’s environment.yml and then setting jupyter to use that environment. Steps I took:
cd ~/fastbook
conda env create --file environment.yml
conda activate fastbook
python -m ipykernel install --user --name=fastbook
pip install -Uqq fastbook
Then in Google Cloud I clicked on the + in the top right, opened a new Launcher, and selected the “fastbook” Notebook. Everything worked once I was running notebooks through this environment.
Make sure the top right “Kernel” selection says fastbook like in the screenshot:
I had this issue, you need to run conda install -c fastai fastbook
and conda will find/install the packages which includes graphviz.
Anyone using GCP have a solution? I can’t seem to get graphviz to load?
This worked, running this in the notebook pip install graphviz
. Thanks to @immarried post here Seeking help - No module named 'graphviz'
Thanks - pip install graphviz
worked for GCP
Run this jupyter cell:
!pip install -Uqq fastbook
!pip install --user graphviz
This worked for me (and I think it was has worked for most in this thread).
Thanks a lot. Installing graphviz using ‘conda install python-graphviz’ worked on my mac.
Had a similar issue. The cuda version you externally installed is not required/doesn’t matter. check the version of cudatoolkit
(conda list cudatoolkit
). This will get you 10.2 I think.
Looks like you have a cuda
mismatch with pytorch
and/or python
.
Remove pytorch
cuda
and torchvision
and reinstall it together as shown below:
conda remove pytorch torchvision cudatoolkit
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1.168 -c pytorch
For fast ai2, based on my NVIDIA driver (430) I chose the cuda 10.1, I needed based on table 1.
Does this help?
P.S
I didn’t need to install cuda externally. pytorch “gets compiled” and delivered with it’s own CUDA via conda (look for cudatoolkit)
conda install graphviz
also is enough and only modifies your current environment in which you are using it.
it does work thanks
conda install python-graphviz worked for me.
pip install graphviz
Works for me.
I did essentially what @heraldb recommended, but here are the conda commands (I was less familiar with Conda so had to look this up. BTW, this GCP with Debian:
conda deactivate
conda create -n fastai
conda activate -n fastai
conda install -c fastai fastbook
conda install -c fastai fastbook
This essentially deactivates the current conda environment, creates a new ones and switches over to that and all seems to work as expected in this friendly new environment.
It did complain about another package (not graphviz) after and I installed it with conda install -c fastai
After that echo “import fastbook” | python3 works!
This just worked for me too. Thanks for (re) posting it.
Even though I just started getting an error message when I tried run my first image classification that “ImageDataBunch” not defined
I too faced this issue and run this code in the terminal in the fastbook directory.
‘pip install -r requirements.txt’
It will work.
This answer worked for me on GCP. I created my GCP instance with the PyTorch environment that already included FastAi libraries and stuff. So the solutions suggesting reinstalling fastbook seemed to cause compatibility issues.
This worked for me also on WSL2 running Ubuntu 20.04