muellerzr / Practical-Deep-Learning-for-Coders-2.0

Notebooks for the "A walk with fastai2" Study Group and Lecture Series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ClassConfusion won't install in Google Colab

md598 opened this issue · comments

commented

"!pip install fastai2 ClassConfusion" is producing the following error in Google Colab (fastai2 tabular already installed):

Requirement already satisfied: fastai2 in /usr/local/lib/python3.6/dist-packages (0.0.30)
ERROR: Could not find a version that satisfies the requirement ClassConfusion (from versions: none)
ERROR: No matching distribution found for ClassConfusion

Thank you!

I know where this stems from, CC got chucked into fastinference, give me a day to update both this notebook and the shap notebook :)

commented

Thank you! Really incredible stuff!

commented

Hey Zach, is there a way to import them from fastinference and use them in the notebook/workaround? Cheers!

Promise I haven't forgotten about this! I'll be free to look at this over the weekend/after the fastai release, until then I won't be able to do much. I'd look at the documentation at muellerzr.github.io/fastinference IIRC it should be as simple as from fastinference.interp import ClassConfusion or something along those lines.

commented

I'll keep trying! Thank you! Best of luck with the release! I taught some co-workers today about collab filtering (using fastai ofc) and it reminded me of your videos. Cheers!

commented

ClassConfusion can install with:
!pip install fastai2 fastinference --quiet
from fastinference.class_confusion import *

SHAP install fails:
from fastinference.tabular import *

error:

ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 from fastinference.tabular import *

2 frames
/usr/local/lib/python3.6/dist-packages/fastinference/tabular/init.py in ()
3 raise ImportError("The interp module is not installed.")
4
----> 5 from .shap import *
6 from .interpretation import *

/usr/local/lib/python3.6/dist-packages/fastinference/tabular/shap/init.py in ()
----> 1 from .interp import *

/usr/local/lib/python3.6/dist-packages/fastinference/tabular/shap/interp.py in ()
5 # Cell
6 from .core import _prepare_data, _predict
----> 7 import shap
8 from fastai2.tabular.all import *
9

ModuleNotFoundError: No module named 'shap'

No luck with pip installs for SHAP, seems to be something about how it's nested within tabular and the init

You need to install via pip install fastinference[interp] as directed in the readme

Pushed a release so this is now fixed.