tensorflow / lucid

A collection of infrastructure and tools for research in neural network interpretability.
Apache License 2.0
4.65k stars 655 forks source link

ChannelReducer breaks with new version of sklearn #220

Closed mcleavey closed 4 years ago

mcleavey commented 4 years ago
AttributeError                            Traceback (most recent call last)
<ipython-input-12-060e126c4e4f> in <module>
----> 1 acts_ = ChannelReducer(6, "NMF").fit_transform(np.maximum(activations,0))

/opt/conda/lib/python3.7/site-packages/lucid/misc/channel_reducer.py in __init__(self, n_components, reduction_alg, **kwargs)
     52     for name in dir(sklearn.decomposition):
     53       obj = sklearn.decomposition.__getattribute__(name)
---> 54       if isinstance(obj, type) and issubclass(obj, sklearn.decomposition.base.BaseEstimator):
     55         algorithm_map[name] = obj
     56     if isinstance(reduction_alg, str):

AttributeError: module 'sklearn.decomposition' has no attribute 'base'
mathemaphysics commented 4 years ago

Sounds like a version issue.

mcleavey commented 4 years ago

(This was Chris Olah posting the issue under my account - definitely seems to be a version issue)

colah commented 4 years ago

Yep! Thanks to @mcleavey for letting me note this down while we were pairing. :)

Seems to be resolved by #221 (pending merge).

bmiselis commented 4 years ago

It's been merged in #221 :)

colah commented 4 years ago

Yes! Thanks this is now resolved thanks to @bmiselis :)