marcoancona / DeepExplain

A unified framework of perturbation and gradient-based attribution methods for Deep Neural Networks interpretability. DeepExplain also includes support for Shapley Values sampling. (ICLR 2018)
https://arxiv.org/abs/1711.06104
MIT License
720 stars 133 forks source link

Any plans to upgrade codebase to Tensorflow 2.x? #62

Closed arundasan91 closed 3 years ago

arundasan91 commented 3 years ago

Hi @marcoancona , I was wondering if there are any plans to upgrade the codebase to TF2.x. Wasn't able to find any roadmaps on the repo.

Thanks, Arun

marcoancona commented 3 years ago

Hi! DeepExplain uses some low-level API to implement DeepLIFT and LRP. It is not straight forward to port to TF2, although there is an open pull-request which adds compatibility with TF2 when eager execution is disabled. Would this help?

arundasan91 commented 3 years ago

I shall check soon and reply back. Closing this for now.

arundasan91 commented 3 years ago

Hi @marcoancona , I can confirm that tensorflow.compat.v1.disable_eager_execution() works on TF2.

However I also added this to the code to make it work for my specific problem:

from tensorflow.compat.v1.keras.backend import get_session
from tensorflow.compat.v1.keras import backend as K