Closed JJGraff closed 2 years ago
Yes, that's unfortunate. Albermax is currently checking if the transition to TF2 is straight forward or not. See the branch with the release candiate 0 for TF2. So the transition to TF2 is planned, but not yet realized...
Thanks for the reply; that's good to know! I'll just revert to TF1.x for now then and follow future updates.
Is there any more info on the transition to tf2? Tried to install innvestigate from branch feature/version2.0_rc0 but can not load the module:
Installation (In virtualenv):
git clone https://github.com/albermax/innvestigate.git
git checkout --track remotes/origin/feature/version2.0_rc0
python setup.py install
Running:
import innvestigate
~/Software/innvestigate/innvestigate/__init__.py in <module>
1
----> 2 from . import analyzer
3 from .analyzer import create_analyzer
4 from .analyzer import NotAnalyzeableModelException
5
~/Software/innvestigate/innvestigate/analyzer/__init__.py in <module>
8 ###############################################################################
9
---> 10 from .base import NotAnalyzeableModelException
11 from .deeplift import DeepLIFTWrapper
12 from .gradient_based import BaselineGradient
~/Software/innvestigate/innvestigate/analyzer/base.py in <module>
19 from .. import layers as ilayers
20 from .. import utils as iutils
---> 21 from ..utils.keras import checks as kchecks
22 from ..utils.keras import graph as kgraph
23
~/Software/innvestigate/innvestigate/utils/keras/checks.py in <module>
10
11 import inspect
---> 12 import tensorflow.python.keras.engine.network as keras_engine_network
13 import tensorflow.keras.activations as keras_activations
14 import tensorflow.keras.layers as keras_layers
AttributeError: module 'tensorflow' has no attribute 'python'
pip freeze
absl-py==0.9.0
astor==0.8.1
backcall==0.1.0
cachetools==4.0.0
certifi==2019.11.28
chardet==3.0.4
colorlover==0.3.0
cycler==0.10.0
decorator==4.4.2
future==0.18.2
gast==0.2.2
google-auth==1.11.2
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
grpcio==1.27.2
h5py==2.10.0
idna==2.9
innvestigate==2.0.0
ipython==7.13.0
ipython-genutils==0.2.0
jedi==0.14.1
JellyBelly==0.0.0
joblib==0.14.1
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
llvmlite==0.31.0
Markdown==3.2.1
matplotlib==3.2.1
numba==0.48.0
numpy==1.18.1
oauthlib==3.1.0
opt-einsum==3.2.0
parso==0.6.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.0.0
pkg-resources==0.0.0
plotly==4.5.4
prompt-toolkit==3.0.4
protobuf==3.11.3
ptyprocess==0.6.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
Pygments==2.6.1
pyparsing==2.4.6
python-dateutil==2.8.1
requests==2.23.0
requests-oauthlib==1.3.0
retrying==1.3.3
rsa==4.0
scikit-learn==0.22.2.post1
scipy==1.4.1
six==1.14.0
tensorboard==2.1.1
tensorflow==2.1.0
tensorflow-estimator==2.1.0
termcolor==1.1.0
traitlets==4.3.3
umap-learn==0.3.10
urllib3==1.25.8
wcwidth==0.1.8
Werkzeug==1.0.0
wrapt==1.12.1
@7PintsOfCherryGarcia
Following import sentence worked in my environment with branch updates_towards_tf2.0
.
from tensorflow.python.keras.engine import network as keras_engine_network
I really appreciate it if this awesome library is updated to support tf2!
Hi @JJGraff, @7PintsOfCherryGarcia and @bmyzk,
we just released iNNvestigate 2.0 with support for TensorFlow 2! Please try it out and let me know if this fixes your issue. :)
Hello @adrhill this issue has repeated in tensorflow 2.12.0 . The error i get is : No module named 'innvestigate.utils.keras' as i try to implement LRP in mobile nets
Hi @JONAHKYAGABA, could you please open a new issue with your platform information and a full stack-trace? Ideally, a minimal code example to reproduce the error as well. Otherwise there isn't much I can do to help.
Thank you for the ressponse @adrhill i have been occupied lately but am back and working on the project .Let me provide the issue.
Hi, First of all many thanks for this great package! I have been using iNNvestigate to perform LRP on keras models successfully. However, I recently upgraded tensorflow from version 1.14 to version 2.0 and it seems to cause problems when I try to use iNNvestigate on keras models with tf-2.0 backend. For instance, when I try to analyse a very simple toy model as follows:
I get the following error path for the last line:
It seems tf 2.0 does not support the condition 'if all([y in used_as_input for y in Ys])'. I have looked for solutions to this error but haven't found anything easily applicable to this case. Is this problem known for iNNvestigate and if so do you know if there is a fix for it? Or would you advise reverting back to tf 1.x?
Thanks in advance!