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

add tf.compat.v1 for tf2 support #56

Open SuryaThiru opened 4 years ago

itsmemala commented 2 years ago

I've been using this fork and just wanted to note that in order to use the DeepExplain library with a model created with TF2 (without having to re-write existing compile and train code), I had to do the following steps first:

  1. Save the model weights
  2. Add the lines: tf.compat.v1.disable_v2_behavior() tf.compat.v1.disable_eager_execution()
  3. Build the model using tf.compat.v1
  4. Load the saved model weights

Might be worth adding to documentation as it might be useful to others...